Skip to content

Commit

Permalink
Makefile: add an explicit rule for building assembly output
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed Jun 10, 2007
1 parent 301ac38 commit e36cb1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ common-cmds.h
*.deb
git-core.spec
*.exe
*.[ao]
*.[aos]
*.py[co]
config.mak
autom4te.cache
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) $<

Expand Down

0 comments on commit e36cb1c

Please sign in to comment.