Subversion Repositories shark

Rev

Rev 64 | 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
8
 
9
include $(BASE)/config/config.mk
10
 
11
LIBRARY       = c
12
 
13
OBJS_PATH     = $(BASE)/libc
14
 
15
SRCS= init.c
16
 
17
OBJS= $(patsubst %.c,%.o,$(SRCS))
18
 
19
install: all $(LIB_PATH)/lib$(LIBRARY).a
20
 
21
clean cleanall depend::
22
	make -C libio $@
23
	make -C quad $@
24
	make -C stdio $@
25
	make -C stdlib $@
26
	make -C assert $@
27
	make -C unistd $@
28
	make -C utsname $@
29
	make -C ctype $@
30
	make -C string $@
267 giacomo 31
	make -C getopt $@
2 pj 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 $@
267 giacomo 53
	make -C getopt $@
2 pj 54
	$(AR) rs lib$(LIBRARY).a $(OBJS)
55
 
56
clean::
57
	$(RM) *.o
58
	$(RM) *.err
59
	$(RM) lib$(LIBRARY).a
60
 
61
cleanall:: clean
62
	$(RM) deps
63
	$(RM) *.bak
64
	$(RM) *.~
65
	$(RM) *.?~
66
	$(RM) *.??~
67
	$(RM) $(LIBRARYPATHNAME)
68
 
69
depend::
70
	$(CC) $(C_OPT) -M $(OBJS:.o=.c) > deps
71
 
72
deps:
73
	$(CC) $(C_OPT) -M $(OBJS:.o=.c) > deps
74
 
75
ifneq ($(MAKECMDGOALS),clean)
76
ifneq ($(MAKECMDGOALS),cleanall)
77
include deps
78
endif
79
endif
80
 
81
$(LIB_PATH)/lib$(LIBRARY).a: lib$(LIBRARY).a copylibrary
82
 
83
copylibrary:
84
	$(CP) lib$(LIBRARY).a $(LIBRARYDIR)
85