Subversion Repositories shark

Rev

Rev 2 | Go to most recent revision | 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
9
	BASE = ../..
10
	BASEDOS = ..\..
11
endif
12
 
13
include $(BASE)/config/config.mk
14
 
15
C_INC= -I. -I$(BASE)/include/ll -I$(BASE)/include
16
C_OPT += -Dlint -Wno-uninitialized -Wno-parentheses
17
ASM_OPT += -Dlint -I.
18
 
19
# by Massy
20
# so there is no conflict with standard libC library
21
C_OPT += -Dwrite=ll_internal_write
22
 
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
78
	$(RM) ..\lib\libhm.a
79
 
80
deps : $(OBJS:.o=.c)
81
	$(CC) $(C_OPT) $(VMINCL) -M $(OBJS:.o=.c) > deps
82
 
83
libhm.a : $(OBJS)
84
	$(AR) rs libhm.a $(OBJS)
85
 
86
deb:
87
	type $(VPATH)
88
 
89
%.s:%.c
90
 
91
ifeq (deps,$(wildcard deps))
92
include deps
93
endif