Skip to content

Commit de54e67

Browse files
jrngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 373a5ed commit de54e67

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,15 +1468,15 @@ strip: $(PROGRAMS) git$X
14681468
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
14691469

14701470
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)"' \
14721472
'-DGIT_HTML_PATH="$(htmldir_SQ)"'
14731473

14741474
git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
14751475
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
14761476
$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
14771477

14781478
builtin-help.o: common-cmds.h
1479-
builtin-help.o: ALL_CFLAGS += \
1479+
builtin-help.s builtin-help.o: ALL_CFLAGS += \
14801480
'-DGIT_HTML_PATH="$(htmldir_SQ)"' \
14811481
'-DGIT_MAN_PATH="$(mandir_SQ)"' \
14821482
'-DGIT_INFO_PATH="$(infodir_SQ)"'
@@ -1637,21 +1637,21 @@ git.o git.spec \
16371637
%.o: %.S GIT-CFLAGS
16381638
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
16391639

1640-
exec_cmd.o: ALL_CFLAGS += \
1640+
exec_cmd.s exec_cmd.o: ALL_CFLAGS += \
16411641
'-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
16421642
'-DBINDIR="$(bindir_relative_SQ)"' \
16431643
'-DPREFIX="$(prefix_SQ)"'
16441644

1645-
builtin-init-db.o: ALL_CFLAGS += \
1645+
builtin-init-db.s builtin-init-db.o: ALL_CFLAGS += \
16461646
-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
16471647

1648-
config.o: ALL_CFLAGS += -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
1648+
config.s config.o: ALL_CFLAGS += -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
16491649

1650-
http.o: ALL_CFLAGS += -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
1650+
http.s http.o: ALL_CFLAGS += -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
16511651

16521652
ifdef NO_EXPAT
16531653
http-walker.o: http.h
1654-
http-walker.o: ALL_CFLAGS += -DNO_EXPAT
1654+
http-walker.s http-walker.o: ALL_CFLAGS += -DNO_EXPAT
16551655
endif
16561656

16571657
git-%$X: %.o $(GITLIBS)

0 commit comments

Comments
 (0)