Rev 3 | Rev 64 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | # |
2 | # The standard lib C |
||
3 | # |
||
4 | |||
5 | ifndef BASE |
||
6 | BASE=.. |
||
7 | endif |
||
45 | pj | 8 | OSLIB=$(BASE)/oslib |
2 | pj | 9 | |
10 | include $(BASE)/config/config.mk |
||
11 | |||
12 | LIBRARY = c |
||
13 | |||
14 | OBJS_PATH = $(BASE)/libc |
||
15 | |||
16 | SRCS= init.c |
||
17 | |||
18 | OBJS= $(patsubst %.c,%.o,$(SRCS)) |
||
19 | |||
20 | install: all $(LIB_PATH)/lib$(LIBRARY).a |
||
21 | |||
22 | clean cleanall depend:: |
||
23 | make -C libio $@ |
||
24 | make -C quad $@ |
||
25 | make -C stdio $@ |
||
26 | make -C stdlib $@ |
||
27 | make -C assert $@ |
||
28 | make -C unistd $@ |
||
29 | make -C utsname $@ |
||
30 | make -C ctype $@ |
||
31 | make -C string $@ |
||
32 | |||
33 | |||
34 | # |
||
35 | # Dependency rules used to make a library |
||
36 | # derived directly from /config/lib.mak |
||
37 | # |
||
38 | |||
39 | .PHONY: all install clean cleanall depend |
||
40 | |||
41 | # |
||
42 | |||
43 | all: $(OBJS) |
||
44 | make -C libio $@ |
||
45 | make -C quad $@ |
||
46 | make -C stdio $@ |
||
47 | make -C stdlib $@ |
||
48 | make -C assert $@ |
||
49 | make -C unistd $@ |
||
50 | make -C utsname $@ |
||
51 | make -C ctype $@ |
||
52 | make -C string $@ |
||
53 | $(AR) rs lib$(LIBRARY).a $(OBJS) |
||
54 | |||
55 | clean:: |
||
56 | $(RM) *.o |
||
57 | $(RM) *.err |
||
58 | $(RM) lib$(LIBRARY).a |
||
59 | |||
60 | cleanall:: clean |
||
61 | $(RM) deps |
||
62 | $(RM) *.bak |
||
63 | $(RM) *.~ |
||
64 | $(RM) *.?~ |
||
65 | $(RM) *.??~ |
||
66 | $(RM) $(LIBRARYPATHNAME) |
||
67 | |||
68 | depend:: |
||
69 | $(CC) $(C_OPT) -M $(OBJS:.o=.c) > deps |
||
70 | |||
71 | deps: |
||
72 | $(CC) $(C_OPT) -M $(OBJS:.o=.c) > deps |
||
73 | |||
74 | ifneq ($(MAKECMDGOALS),clean) |
||
75 | ifneq ($(MAKECMDGOALS),cleanall) |
||
76 | include deps |
||
77 | endif |
||
78 | endif |
||
79 | |||
80 | $(LIB_PATH)/lib$(LIBRARY).a: lib$(LIBRARY).a copylibrary |
||
81 | |||
82 | copylibrary: |
||
83 | $(CP) lib$(LIBRARY).a $(LIBRARYDIR) |
||
84 |