Rev 508 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1025 | mauro | 1 | # |
2 | # |
||
3 | # |
||
2 | pj | 4 | |
1025 | mauro | 5 | .PHONY: depend |
6 | |||
2 | pj | 7 | ifndef BASE |
8 | BASE=../.. |
||
9 | endif |
||
45 | pj | 10 | |
2 | pj | 11 | include $(BASE)/config/config.mk |
12 | |||
13 | include $(BASE)/config/libdep.mk |
||
14 | |||
15 | ifdef INIT |
||
16 | INIT_FILE:=$(LIB_PATH)/$(INIT) |
||
17 | else |
||
18 | INIT_FILE:= |
||
19 | endif |
||
20 | |||
1025 | mauro | 21 | #MYOBJS= $(addsuffix .c,$(PROGS)) $(OBJS) |
2 | pj | 22 | MYOBJS:=$(APP).o $(INIT_FILE) $(OTHEROBJS) |
23 | |||
24 | $(APP):$(MYOBJS) $(LIB_DEP) |
||
25 | $(LD) $(LINK_OPT) $(LINK_STARTUP) $(MYOBJS) \ |
||
508 | giacomo | 26 | --start-group $(LINK_LIB) $(OTHERLIBS) --end-group \ |
2 | pj | 27 | -o $(APP) |
28 | |||
1025 | mauro | 29 | #depend: |
30 | # $(CC) $(C_OPT) -M $(wildcard $(MYOBJS:.o=.c) $(MYOBJS:.o=.s)) > deps |
||
2 | pj | 31 | |
1025 | mauro | 32 | deps_$(APP): |
33 | $(CC) $(C_OPT) -M $(wildcard $(MYOBJS:.o=.c) $(MYOBJS:.o=.s)) > deps_$(APP) |
||
2 | pj | 34 | |
1025 | mauro | 35 | ifneq ($(MAKECMDGOALS),clean) |
36 | ifneq ($(MAKECMDGOALS),cleanall) |
||
37 | include deps_$(APP) |
||
38 | endif |
||
39 | endif |
||
2 | pj | 40 | |
1025 | mauro | 41 | # Common rules |
42 | %.o : %.s |
||
43 | $(REDIR) $(CC) $(ASM_OPT) $(ASM_OUTPUT) -c $< |
||
44 | %.o : %.c |
||
45 | $(REDIR) $(CC) $(C_OPT) $(C_OUTPUT) -c $< |
||
46 | %.s : %.c |
||
47 | $(REDIR) $(CC) $(C_OPT) $(C_OUTPUT) -S $< |
||
48 | %.o : %.cpp |
||
49 | $(REDIR) $(CPP) $(C_OPT) $(C_OUTPUT) -c $< |
||
2 | pj | 50 | |
51 | |||
52 | |||
1025 | mauro | 53 | |
54 | |||
55 | |||
56 | |||
57 |