Declare COERCE and two helpers as EXPLICIT-CHECK.
[sbcl.git] / src / runtime / GNUmakefile
blob737a0f648ee2630475ca68e07e44a3239d332e76
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 tags
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 LINKFLAGS = -g
21 NM = nm -gp
22 DEPEND_FLAGS = -MM
23 GREP = grep
25 include ../../output/prefix.def
27 CFLAGS = -g -Wall -Wsign-compare -O3
28 ASFLAGS = $(CFLAGS)
29 CPPFLAGS = -I. -DSBCL_PREFIX=\"$(SBCL_PREFIX)\"
31 # Give make access to the target Lisp features.
32 include genesis/Makefile.features
34 # The Config file is the preferred place for tweaking options which
35 # are appropriate for particular setups (OS, ARCH, whatever). Make a
36 # Config-foo file for setup foo, then arrange for Config to be a
37 # symlink to Config-foo.
38 # Commonly used variables in Config are: ARCH_SRC, ASSEM_SRC, GC_SRC,
39 # OS_SRC, OS_LIBS, OS_CLEAN_FILES
40 include Config
42 COMMON_SRC = alloc.c backtrace.c breakpoint.c coreparse.c \
43 dynbind.c funcall.c gc-common.c globals.c interr.c interrupt.c \
44 largefile.c monitor.c os-common.c parse.c print.c purify.c \
45 pthread-futex.c \
46 regnames.c run-program.c runtime.c safepoint.c save.c search.c \
47 thread.c time.c util.c validate.c vars.c wrap.c
49 C_SRC = $(COMMON_SRC) ${ARCH_SRC} ${OS_SRC} ${GC_SRC}
51 SRCS = $(C_SRC) ${ASSEM_SRC}
53 OBJS = $(C_SRC:.c=.o) $(ASSEM_SRC:.S=.o)
55 LIBS = ${OS_LIBS} -lm
57 targets: $(TARGET) sbcl.nm
59 $(TARGET): $(OBJS)
60 $(CC) ${LINKFLAGS} -o $@ $^ $(LIBS)
62 sbcl.nm: $(TARGET)
63 $(NM) $(TARGET) | $(GREP) -v " [FUw] " > ,$@
64 mv -f ,$@ $@
66 sbcl.h: $(wildcard genesis/*.h)
67 echo '#include "genesis/config.h"' >sbcl.h
68 echo '#include "genesis/constants.h"' >>sbcl.h
70 # || true because we don't want the build to break if etags isn't there.
71 # ...but it's still nice to have it done by default.
72 TAGS tags: $(SRCS)
73 etags $(SRCS) || true
75 clean:
76 -rm -f *.[do] $(TARGET) sbcl.nm sbcl.h core *.tmp $(OS_CLEAN_FILES)
78 %.d: %.c sbcl.h
79 @$(CC) $(DEPEND_FLAGS) $(CPPFLAGS) $< > $@.tmp; \
80 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.tmp > $@; \
81 rm -f $@.tmp
83 %.d: %.S sbcl.h
84 @$(CC) $(DEPEND_FLAGS) $(CPPFLAGS) $< > $@.tmp; \
85 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.tmp > $@; \
86 rm -f $@.tmp
88 # By including those files, we cause GNU make to automatically re-make
89 # all dependencies of the .c file if necessary.
90 ifneq ($(MAKECMDGOALS),clean)
91 -include $(C_SRC:.c=.d) $(ASSEM_SRC:.S=.d)
92 endif