build: Allow generating dependencies as a side-effect of assembling

This commit is contained in:
Diego Biurrun
2016-10-13 02:45:09 +02:00
parent 39e208f4d4
commit 3c0efbd033
2 changed files with 11 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ CCFLAGS = $(CPPFLAGS) $(CFLAGS)
OBJCFLAGS += $(EOBJCFLAGS)
OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
X86ASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
X86ASMFLAGS += $(IFLAGS:%=%/) -I$(<D)/ -Pconfig.asm
HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
@@ -42,6 +42,7 @@ endef
COMPILE_C = $(call COMPILE,CC)
COMPILE_S = $(call COMPILE,AS)
COMPILE_M = $(call COMPILE,OBJCC)
COMPILE_X86ASM = $(call COMPILE,X86ASM)
COMPILE_HOSTC = $(call COMPILE,HOSTCC)
%.o: %.c
@@ -57,8 +58,7 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
$(COMPILE_HOSTC)
%.o: %.asm
$(DEPX86ASM) $(X86ASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
$(X86ASM) $(X86ASMFLAGS) -I $(<D)/ -o $@ $<
$(COMPILE_X86ASM)
-$(STRIP) $(STRIPFLAGS) $@
%.i: %.c