7b8159cf596d81615e26faa44094f0730993cd32
[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 #
18 # FIXME: The -fno-strength-reduce flag comes from before the fork
19 # from CMU CL. It's presumably to work around some optimizer bug in gcc,
20 # but the fork was a long time ago, and the optimizer could easily
21 # have been fixed since then. Try doing without it.
22 # CFLAGS =  -g -Wall -O2 -fno-strength-reduce -DGENCGC
23 CFLAGS =  -g -Wall -O3 -DGENCGC
24 ASFLAGS = -g -DGENCGC
25 DEPEND_FLAGS =
26 CPPFLAGS = -I.
27
28 # The Config file is the preferred place for tweaking options which
29 # are appropriate for particular setups (OS, CPU, whatever). Make a
30 # Config-foo file for setup foo, then arrange for Config to be a
31 # symlink to Config-foo.
32 include Config
33
34 # Some of these things might be Config-dependent in future versions,
35 # but they're not right now, i.e., they happen to be the same for
36 # all supported systems.
37 CPP = cpp
38 GC_SRC = gencgc.c
39 LD = ld
40 LINKFLAGS = -g
41 NM = nm -gp
42
43 SRCS =  alloc.c backtrace.c breakpoint.c coreparse.c \
44         dynbind.c globals.c interr.c interrupt.c \
45         monitor.c parse.c print.c purify.c \
46         regnames.c run-program.c runtime.c save.c search.c \
47         time.c validate.c vars.c \
48         ${ARCH_SRC} ${ASSEM_SRC} ${OS_SRC} ${GC_SRC}
49
50 OBJS = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(patsubst %.s,%.o,$(SRCS))))
51
52 sbcl.nm: sbcl
53         $(NM) sbcl | grep -v " F \| U " > ,$@
54         mv -f ,$@ $@
55
56 sbcl: ${OBJS} 
57         $(CC) ${LINKFLAGS} ${OS_LINK_FLAGS} -o $@ ${OBJS} ${OS_LIBS} -lm
58
59 .PHONY: clean all
60 clean:
61         rm -f depend *.o sbcl sbcl.nm core *.tmp ; true
62
63 depend: ${SRCS} sbcl.h
64         $(CC) -MM -E ${DEPEND_FLAGS} ${CFLAGS} ${CPPFLAGS} $? > depend.tmp
65         mv -f depend.tmp depend