Makefile: add an explicit rule for building assembly output
In the kernel we have a rule for *.c -> *.s files exactly because it's nice to be able to easily say "ok, what does that generate". Here's a patch to add such a rule to git too, in case anybody is interested. It makes it much simpler to just do make sha1_file.s and look at the compiler-generated output that way, rather than having to fire up gdb on the resulting binary. (Add -fverbose-asm or something if you want to, it can make the result even more readable) [jc: add *.s to .gitignore] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Linus Torvalds committed
May 30, 2007 at 10:42 UTC
e36cb1c16dfd10622fb9da1dffb478240b7e7713
2 files changed
+3
-1
.gitignore
+1
-1
@@ -159,7 +159,7 @@ common-cmds.h
159
*.deb
160
git-core.spec
161
*.exe
162
-*.[ao]
162
+*.[aos]
163
*.py[co]
164
config.mak
165
autom4te.cache
Makefile
+2
@@ -845,6 +845,8 @@ git$X git.spec \
845
846
%.o: %.c GIT-CFLAGS
847
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
848
+%.s: %.c GIT-CFLAGS
849
+ $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
850
%.o: %.S
851
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
852