forked from wmanley/cisco-vqe-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepend.mk
50 lines (40 loc) · 1.39 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
###############################################################################
# depend.mk
#
# Copyright (c) 2006-2007 by Cisco Systems, Inc.
# All rights reserved.
###############################################################################
#=============================================
# Depend
#
ifeq ($(DEP_FILES),)
DEP_FILES = $(patsubst $(SRCDIR)/%, $(MODOBJ)/%, $(subst .s,.dep, $(subst .S,.dep, $(subst .c,.dep, $(subst .cpp,.dep, $(sort $(SRC)))))))
endif
.PHONY: depend
depend:
$(RM) $(DEP_FILES)
@$(MAKE) NO_DEPEND=true $(DEP_FILES)
$(MODOBJ)/%.dep : $(SRCDIR)/%.c
@test -d $(MODOBJ) || mkdir $(MODOBJ)
$(CC) -M $(CFLAGS) $(INCLUDES) $< > $@.$$$$;\
sed 's,\($*\)\.o[ :]*,$(MODOBJ)/\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
$(MODOBJ)/%.dep : $(SRCDIR)/%.S
@test -d $(MODOBJ) || mkdir $(MODOBJ)
$(CC) -M $(CFLAGS) $< > $@.$$$$;\
sed 's,\($*\)\.o[ :]*,$(MODOBJ)/\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
$(MODOBJ)/%.dep : $(SRCDIR)/%.s
@test -d $(MODOBJ) || mkdir $(MODOBJ)
$(CC) -M $(CFLAGS) $< > $@.$$$$;\
sed 's,\($*\)\.o[ :]*,$(MODOBJ)/\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
$(MODOBJ)/%.dep : $(SRCDIR)/%.cpp
@test -d $(MODOBJ) || mkdir $(MODOBJ)
$(CXX) -M $(CXXFLAGS) -o $(*F).opp $< > $@.$$$$;\
sed 's,\($*\)\.o[ :]*,$(MODOBJ)/\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
$(DEP_FILES) : $(GENINCLUDES)
ifndef NO_DEPEND
-include $(DEP_FILES)
endif