Subversion Repositories shark

Rev

Rev 45 | 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 $@
31
 
32
 
33
#
34
# Dependency rules used to make a library
35
# derived directly from /config/lib.mak
36
#
37
 
38
.PHONY: all install clean cleanall depend
39
 
40
#
41
 
42
all: $(OBJS)
43
	make -C libio $@
44
	make -C quad $@
45
	make -C stdio $@
46
	make -C stdlib $@
47
	make -C assert $@
48
	make -C unistd $@
49
	make -C utsname $@
50
	make -C ctype $@
51
	make -C string $@
52
	$(AR) rs lib$(LIBRARY).a $(OBJS)
53
 
54
clean::
55
	$(RM) *.o
56
	$(RM) *.err
57
	$(RM) lib$(LIBRARY).a
58
 
59
cleanall:: clean
60
	$(RM) deps
61
	$(RM) *.bak
62
	$(RM) *.~
63
	$(RM) *.?~
64
	$(RM) *.??~
65
	$(RM) $(LIBRARYPATHNAME)
66
 
67
depend::
68
	$(CC) $(C_OPT) -M $(OBJS:.o=.c) > deps
69
 
70
deps:
71
	$(CC) $(C_OPT) -M $(OBJS:.o=.c) > deps
72
 
73
ifneq ($(MAKECMDGOALS),clean)
74
ifneq ($(MAKECMDGOALS),cleanall)
75
include deps
76
endif
77
endif
78
 
79
$(LIB_PATH)/lib$(LIBRARY).a: lib$(LIBRARY).a copylibrary
80
 
81
copylibrary:
82
	$(CP) lib$(LIBRARY).a $(LIBRARYDIR)
83