From: Linus Torvalds Date: Wed, 30 May 2007 17:42:41 +0000 (-0700) Subject: Makefile: add an explicit rule for building assembly output X-Git-Tag: v1.5.3-rc0~128 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e36cb1c16dfd10622fb9da1dffb478240b7e7713;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/.gitignore b/.gitignore index 27e5aeb8a..bd49cd462 100644 --- a/.gitignore +++ b/.gitignore @@ -159,7 +159,7 @@ common-cmds.h *.deb git-core.spec *.exe -*.[ao] +*.[aos] *.py[co] config.mak autom4te.cache diff --git a/Makefile b/Makefile index 0f7595552..30a405292 100644 --- a/Makefile +++ b/Makefile @@ -845,6 +845,8 @@ git$X git.spec \ %.o: %.c GIT-CFLAGS $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $< +%.s: %.c GIT-CFLAGS + $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< %.o: %.S $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<