Subversion Repositories shark

Rev

Rev 82 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
#
2
# Dependency rules used to make a library
3
#
4
 
5
.PHONY: all install clean cleanall depend
6
 
7
#
8
 
9
install:: $(LIB_PATH)/lib$(LIBRARY).a all
10
 
11
all:: lib$(LIBRARY).a
12
 
13
clean::
48 pj 14
	$(RM) $(OBJS) *.o
2 pj 15
	$(RM) *.err
16
	$(RM) lib$(LIBRARY).a
17
 
18
cleanall:: clean
19
	$(RM) deps
20
	$(RM) *.bak
21
	$(RM) *.~
22
	$(RM) *.?~
23
	$(RM) *.??~
24
	$(RM) $(LIBRARYPATHNAME)
25
 
26
depend::
82 pj 27
	$(CC) $(C_OPT) -M $(wildcard $(OBJS:.o=.c) $(OBJS:.o=.cpp) $(OBJS:.o=.s)) > deps
2 pj 28
 
29
deps:
82 pj 30
	$(CC) $(C_OPT) -M $(wildcard $(OBJS:.o=.c) $(OBJS:.o=.cpp) $(OBJS:.o=.s)) > deps
2 pj 31
 
32
ifneq ($(MAKECMDGOALS),clean)
33
ifneq ($(MAKECMDGOALS),cleanall)
34
include deps
35
endif
36
endif
37
 
1025 mauro 38
# Common rules
39
%.o : %.s
40
	$(REDIR) $(CC) $(ASM_OPT) $(ASM_OUTPUT) -c $<
41
%.o : %.c
42
	$(REDIR) $(CC) $(C_OPT) $(C_OUTPUT) -c $<
43
%.s : %.c
44
	$(REDIR) $(CC) $(C_OPT) $(C_OUTPUT) -S $<
45
%.o : %.cpp
46
	$(REDIR) $(CPP) $(C_OPT) $(C_OUTPUT) -c $<
47
 
2 pj 48
lib$(LIBRARY).a: $(OBJS)
49
	$(AR) rs lib$(LIBRARY).a $(OBJS)
50
 
51
$(LIB_PATH)/lib$(LIBRARY).a: lib$(LIBRARY).a
52
	$(CP) lib$(LIBRARY).a $(LIBRARYDIR)
53