1.0.19.33: Improved interrupt handling on darwin/x86[-64]
[sbcl/eslaughter.git] / src / runtime / GNUmakefile
blobcfaac204c351f462e9c11eafc33cf5b58101b007
1 # -*- makefile -*- for the C-level run-time support for SBCL
3 # This software is part of the SBCL system. See the README file for
4 # more information.
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.
12 .PHONY: all clean TAGS tags targets
14 all: targets
15 TARGET=sbcl
17 # Defaults which might be overridden or modified by values in the
18 # Config file. Most of them are same on most systems right now.
19 # If you need to override one of these, do it in Config.
20 LD = ld
21 LINKFLAGS = -g
22 NM = nm -gp
23 DEPEND_FLAGS = -MM
24 GREP = grep
26 CFLAGS = -g -Wall -Wsign-compare -O3
27 ASFLAGS = $(CFLAGS)
28 CPPFLAGS = -I.
30 # Give make access to the target Lisp features.
31 include genesis/Makefile.features
33 # The Config file is the preferred place for tweaking options which
34 # are appropriate for particular setups (OS, ARCH, whatever). Make a
35 # Config-foo file for setup foo, then arrange for Config to be a
36 # symlink to Config-foo.
37 # Commonly used variables in Config are: ARCH_SRC, ASSEM_SRC, GC_SRC,
38 # OS_SRC, OS_LIBS, OS_OBJS, OS_CLEAN_FILES
39 include Config
41 COMMON_SRC = alloc.c backtrace.c breakpoint.c coreparse.c \
42 dynbind.c funcall.c gc-common.c globals.c interr.c interrupt.c \
43 largefile.c monitor.c os-common.c parse.c print.c purify.c \
44 pthread-futex.c pthread-lutex.c \
45 regnames.c run-program.c runtime.c save.c search.c \
46 thread.c time.c util.c validate.c vars.c wrap.c
48 C_SRC = $(COMMON_SRC) ${ARCH_SRC} ${OS_SRC} ${GC_SRC}
50 SRCS = $(C_SRC) ${ASSEM_SRC}
52 OBJS = $(C_SRC:.c=.o) $(ASSEM_SRC:.S=.o) ${OS_OBJS}
54 LIBS = ${OS_LIBS} -lm
56 targets: $(TARGET) sbcl.nm
58 $(TARGET): $(OBJS)
59 $(CC) ${LINKFLAGS} -o $@ $^ $(LIBS)
61 sbcl.nm: $(TARGET)
62 $(NM) $(TARGET) | $(GREP) -v " [FUw] " > ,$@
63 mv -f ,$@ $@
65 sbcl.h: $(wildcard genesis/*.h)
66 echo '#include "genesis/config.h"' >sbcl.h
67 echo '#include "genesis/constants.h"' >>sbcl.h
69 TAGS tags: $(SRCS)
70 etags $(SRCS)
72 clean:
73 -rm -f *.[do] $(TARGET) sbcl.nm sbcl.h core *.tmp $(OS_CLEAN_FILES)
75 %.d: %.c sbcl.h
76 @$(CC) $(DEPEND_FLAGS) $(CPPFLAGS) $< > $@.tmp; \
77 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.tmp > $@; \
78 rm -f $@.tmp
80 %.d: %.S sbcl.h
81 @$(CC) $(DEPEND_FLAGS) $(CPPFLAGS) $< > $@.tmp; \
82 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.tmp > $@; \
83 rm -f $@.tmp
85 # By including those files, we cause GNU make to automatically re-make
86 # all dependencies of the .c file if necessary.
87 ifneq ($(MAKECMDGOALS),clean)
88 -include $(C_SRC:.c=.d) $(ASSEM_SRC:.S=.d)
89 endif