@matheusbsbs / matheus-bagliano / commits / de54e67c1a
Fork 0

Makefile: learn to generate listings for targets requiring special flags

'make git.s' to debug code generation of main() fails because git.c makes use of preprocessor symbols such as GIT_VERSION that are not set. make does not generate code listings for builtin_help.c, exec_cmd.c, builtin-init-db.c, config.c, http.c, or http-walker.c either, for the same reason. So pass the flags used to generate each .o file when generating the corresponding assembler listing. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Jan 6, 2010 at 02:06 UTC de54e67c1a892167ade274017a946de1f99920d1
1 file changed +7 -7
Makefile
+7 -7
@@ -1468,7 +1468,7 @@ strip: $(PROGRAMS) git$X
1468 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
1469
1470 git.o: common-cmds.h
1471 -git.o: ALL_CFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"' \
1471 +git.s git.o: ALL_CFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"' \
1472 '-DGIT_HTML_PATH="$(htmldir_SQ)"'
1473
1474 git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
@@ -1476,7 +1476,7 @@ git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
1476 $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
1477
1478 builtin-help.o: common-cmds.h
1479 -builtin-help.o: ALL_CFLAGS += \
1479 +builtin-help.s builtin-help.o: ALL_CFLAGS += \
1480 '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
1481 '-DGIT_MAN_PATH="$(mandir_SQ)"' \
1482 '-DGIT_INFO_PATH="$(infodir_SQ)"'
@@ -1637,21 +1637,21 @@ git.o git.spec \
1637 %.o: %.S GIT-CFLAGS
1638 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
1639
1640 -exec_cmd.o: ALL_CFLAGS += \
1640 +exec_cmd.s exec_cmd.o: ALL_CFLAGS += \
1641 '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
1642 '-DBINDIR="$(bindir_relative_SQ)"' \
1643 '-DPREFIX="$(prefix_SQ)"'
1644
1645 -builtin-init-db.o: ALL_CFLAGS += \
1645 +builtin-init-db.s builtin-init-db.o: ALL_CFLAGS += \
1646 -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
1647
1648 -config.o: ALL_CFLAGS += -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
1648 +config.s config.o: ALL_CFLAGS += -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
1649
1650 -http.o: ALL_CFLAGS += -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
1650 +http.s http.o: ALL_CFLAGS += -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
1651
1652 ifdef NO_EXPAT
1653 http-walker.o: http.h
1654 -http-walker.o: ALL_CFLAGS += -DNO_EXPAT
1654 +http-walker.s http-walker.o: ALL_CFLAGS += -DNO_EXPAT
1655 endif
1656
1657 git-%$X: %.o $(GITLIBS)