blob: 72264f5cf11f14e8c0a207b7b140bdd09f56629d [file] [log] [blame]
Yue Lun03a82d92013-10-21 10:15:02 +08001
2include $(PRJ_PATH)/make/$(OS)_opt.mk
3
4include $(PRJ_PATH)/make/tools.mk
5
6obj: $(OBJ_LIST)
7 $(OBJ_LOOP)
8
9dep: build_dir $(DEP_LIST)
10 $(DEP_LOOP)
11
12$(OBJ_LIST): %.o : %.c %.d
slv517786c2015-10-28 13:50:52 +080013 $(CC) $(CFLAGS) $(LOCAL_CFLAGS) -c $< -o $(DST_DIR)/$@
Yue Lun03a82d92013-10-21 10:15:02 +080014
15$(DEP_LIST) : %.d : %.c
slv517786c2015-10-28 13:50:52 +080016 $(CC) $(CFLAGS) $(LOCAL_CFLAGS) -MM $< > $(DST_DIR)/$@.tmp
Yue Lun03a82d92013-10-21 10:15:02 +080017 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $(DST_DIR)/$@.tmp > $(DST_DIR)/$@
18 $(RM) -f $(DST_DIR)/$@.tmp;
19
20build_dir: $(DST_DIR)
21
22$(DST_DIR):
23 $(MKDIR) -p $(DST_DIR)
24
25.PHONY: clean
26clean: clean_o clean_d
27 $(CLEAN_LOOP)
28
29.PHONY: clean_o
30clean_o: clean_obj
31 $(CLEAN_OBJ_LOOP)
32
33.PHONY: clean_d
34clean_d: clean_dep
35 $(CLEAN_DEP_LOOP)
36
37clean_obj:
38ifneq (,$(word 1, $(OBJ_FILE)))
39 $(RM) -f $(OBJ_FILE)
40endif
41
42clean_dep:
43ifneq (,$(word 1, $(DEP_FILE)))
44 $(RM) -f $(DEP_FILE)
45endif
46
47ifneq (,$(word 1, $(DEP_FILE)))
48 sinclude $(DEP_FILE)
49endif