Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | # Standard library for X/COFF kernel |
2 | # Makefile for GNU MAKE & GCC 2.8.0 |
||
3 | |||
4 | # |
||
5 | # Standard path |
||
6 | # |
||
7 | |||
8 | ifndef BASE |
||
40 | pj | 9 | BASE = .. |
10 | BASEDOS = .. |
||
2 | pj | 11 | endif |
12 | |||
40 | pj | 13 | include $(BASE)/config.mk |
2 | pj | 14 | |
40 | pj | 15 | C_OPT += -I$(INCL)/ll -I. |
2 | pj | 16 | C_OPT += -Dlint -Wno-uninitialized -Wno-parentheses |
17 | ASM_OPT += -Dlint -I. |
||
18 | |||
40 | pj | 19 | C_OPT += -Dwrite=glue_write |
2 | pj | 20 | |
40 | pj | 21 | |
22 | |||
2 | pj | 23 | SRCDIRS = msun/src msun/i387 machine |
24 | space := $(empty) $(empty) |
||
25 | |||
26 | vpath %.s msun/i387 |
||
27 | vpath %.c msun/src machine |
||
28 | |||
29 | # First find a list of every file that might possibly be a source file, |
||
30 | # so we only have to scan the source directories once. |
||
31 | FILES := $(foreach DIR,$(SRCDIRS),$(wildcard $(DIR)/*)) |
||
32 | |||
33 | |||
34 | # C source files |
||
35 | CFILES := $(filter %.c,$(FILES)) |
||
36 | SFILES := $(filter %.s,$(FILES)) |
||
37 | |||
38 | |||
39 | # The generated object files have the same prefix names as the source files, |
||
40 | # except they live in the current (object) directory. |
||
41 | OBJFILES += $(patsubst %.s,%.o,$(notdir $(SFILES))) |
||
42 | OBJFILES += $(patsubst %.c,%.o,$(notdir $(CFILES))) |
||
43 | |||
44 | # This is to eliminate duplicate files, |
||
45 | # which might appear when files are being overridden. |
||
46 | OBJFILES := $(sort $(OBJFILES)) |
||
47 | |||
48 | OBJS = $(STUB_OBJS) $(OBJFILES) |
||
49 | |||
50 | # |
||
51 | # Ok! Finally the dependency rules! |
||
52 | # We do not mess with automatic depencencies here!! |
||
53 | # |
||
54 | |||
55 | .PHONY : all clean info install |
||
56 | |||
57 | .SUFFIXES: |
||
58 | |||
59 | info : |
||
60 | @echo "OSLib Makefile" |
||
61 | @echo "Chose: all, install, clean" |
||
62 | |||
63 | |||
64 | all : libhm.a |
||
65 | |||
66 | install : libhm.a $(LIB_DIR) |
||
67 | $(CP) libhm.a $(LIB_DIR) |
||
68 | |||
69 | $(LIB_DIR) : |
||
70 | $(MKDIR) $(LIB_DIR) |
||
71 | clean : |
||
72 | $(RM) *.o |
||
73 | $(RM) *.err |
||
74 | $(RM) libhm.a |
||
75 | |||
76 | allclean : clean |
||
77 | echo # Kernel Dependency file > deps |
||
40 | pj | 78 | $(RM) (LIB_PATH)libhm.a |
2 | pj | 79 | |
40 | pj | 80 | #deps : $(OBJS:.o=.c) |
81 | deps : makefile $(CFILES) |
||
82 | $(CC) $(C_OPT) -M $(CFILES) > deps |
||
2 | pj | 83 | |
84 | libhm.a : $(OBJS) |
||
85 | $(AR) rs libhm.a $(OBJS) |
||
86 | |||
87 | deb: |
||
40 | pj | 88 | echo $(CFILES) |
2 | pj | 89 | |
90 | %.s:%.c |
||
91 | |||
92 | ifeq (deps,$(wildcard deps)) |
||
93 | include deps |
||
94 | endif |