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
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 CFLAGS = -g -Wall -O2 -fdollars-in-identifiers
13 OS_SRC = bsd-os.c ppc-darwin-os.c ppc-darwin-dlshim.c ppc-darwin-langinfo.c
14 OS_LIBS = -lSystem -lc
15 OS_OBJS = ppc-darwin-rospace.o
19 ASSEM_SRC = ppc-assem.S ldso-stubs.S
22 CPPFLAGS += -no-cpp-precomp
24 # KLUDGE: in OS X 10.3, Apple started putting the heap right where we
25 # expect our read-only space mapped. This hack causes the linker to
26 # place a zero-fill-on-demand segment in the same place and size as
27 # read-only-space, which is the only thing capable of keeping malloc
29 LINKFLAGS += -dynamic `cat ppc-darwin-link-flags` -twolevel_namespace -bind_at_load
33 OS_CLEAN_FILES += ppc-darwin-mkrospace ppc-darwin-fix-rospace ppc-darwin-link-flags
35 ppc-darwin-mkrospace: ppc-darwin-mkrospace.c
36 $(CC) -g -Wall -pedantic -o $@ $<
38 ppc-darwin-fix-rospace: ppc-darwin-fix-rospace.c
39 $(CC) -g -Wall -pedantic -o $@ $<
41 ppc-darwin-rospace.o ppc-darwin-link-flags: ppc-darwin-mkrospace
42 ./ppc-darwin-mkrospace > ppc-darwin-link-flags
44 .PHONY: after-grovel-headers
46 # Fix the sbcl runtime to avoid Panther placing the heap where
47 # it wants read only space (in the first 32 megabytes, where it
48 # can be absolute-branched to with BA.) Must be done after
49 # grovel-headers, because Apple's nm is broken.
50 after-grovel-headers: ppc-darwin-fix-rospace
51 ./ppc-darwin-fix-rospace
53 # Fortunatly make-target-1.sh does a make clean all the time.
54 # Otherwise we would have to make sure that sbcl gets rebuilt without
55 # the readonlyspace hack before groveling headers again.