0.9.1.2:
[sbcl.git] / src / runtime / GNUmakefile
1 # makefile for the C-level run-time support for SBCL
2
3 # This software is part of the SBCL system. See the README file for
4 # more information.
5 #
6 # This software is derived from the CMU CL system, which was
7 # written at Carnegie Mellon University and released into the
8 # public domain. The software is in the public domain and is
9 # provided with absolutely no warranty. See the COPYING and CREDITS
10 # files for more information.
11
12 all: sbcl sbcl.nm
13 .PHONY: all
14
15 # defaults which might be overridden or modified by values in the
16 # Config file
17 CFLAGS =  -g -Wall -O3
18 ASFLAGS = $(CFLAGS)
19 CPPFLAGS = -I.
20
21 # Some of these things might be Config-dependent in future versions,
22 # but they're the same on most systems right now.  If you need to
23 # override one of these, do it in Config
24 CPP = cpp
25 LD = ld
26 LINKFLAGS = -g
27 NM = nm -gp
28 DEPEND_FLAGS=-M
29
30 # The Config file is the preferred place for tweaking options which
31 # are appropriate for particular setups (OS, CPU, whatever). Make a
32 # Config-foo file for setup foo, then arrange for Config to be a
33 # symlink to Config-foo.
34 include Config
35
36
37 C_SRCS = alloc.c backtrace.c breakpoint.c coreparse.c \
38         dynbind.c gc-common.c globals.c interr.c interrupt.c \
39         monitor.c parse.c print.c purify.c \
40         regnames.c run-program.c runtime.c save.c search.c \
41         thread.c time.c util.c validate.c vars.c wrap.c 
42
43 SRCS = $(C_SRCS) ${ARCH_SRC} ${ASSEM_SRC} ${OS_SRC} ${GC_SRC}
44
45 OBJS = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(patsubst %.s,%.o,$(SRCS)))) ${OS_OBJS}
46
47 sbcl.nm: sbcl
48         $(NM) sbcl | grep -v " F \| U " > ,$@
49         mv -f ,$@ $@
50
51 sbcl: ${OBJS} 
52         $(CC) ${LINKFLAGS} ${OS_LINK_FLAGS} -o $@ ${OBJS} ${OS_OBJS} ${OS_LIBS} -lm
53
54
55 .PHONY: clean
56 clean:
57         -rm -f depend *.o sbcl sbcl.nm core *.tmp $(CLEAN_FILES)
58
59 TAGS: $(SRCS)
60         etags $(SRCS)
61
62 sbcl.h: genesis/*.h
63         echo '#include "genesis/config.h"' >sbcl.h
64         echo '#include "genesis/constants.h"' >>sbcl.h
65
66 depend: ${C_SRCS} sbcl.h
67         $(CC) ${DEPEND_FLAGS} ${CFLAGS} ${CPPFLAGS}  ${C_SRCS} > depend.tmp
68         mv -f depend.tmp depend
69
70 # By including this file, we cause GNU make to automatically "make depend"
71 # if it can't find it or it is out of date.
72 include depend