-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepend.mk
25 lines (20 loc) · 892 Bytes
/
depend.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# ------------------------------------------------------------------------------
# depender
# ------------------------------------------------------------------------------
#$(SRC.D) depend
ifeq ($(CC),gcc)
$(DEPEND_PATH)/%.d : $(SOURCE_PATH)/%.c $(DEPEND_PATH)
@echo $(MAKEDEPEND) $(DEPOPT) $<
@ $(MAKEDEPEND) $(DEPOPT) $< |\
$(PERL) -pe 'chomp;s/\\//g;' |\
$(PERL) -pe 's/(\S+)://;$$s=$$1;s/\s+/\n$$s: /g;' |\
$(PERL) -e 'foreach(<STDIN>){print "$$ARGV[0]$$_" unless /^\s*$$/} \
print "\n"' $(OBJECT_PATH)/ > $@
endif
ifeq ($(CC),cc)
$(DEPEND_PATH)/%.d : $(SOURCE_PATH)/%.c
@echo $(MAKEDEPEND) $(DEPOPT) $<
@ $(MAKEDEPEND) $(DEPOPT) $< |\
$(PERL) -e 'foreach(<STDIN>){print "$$ARGV[0]$$_" unless /^\s*$$/}'\
$(OBJECT_PATH)/ > $@
endif