source: trunk/source/lisp-kernel/darwinx8664/Makefile @ 15161

Last change on this file since 15161 was 15161, checked in by rme, 8 years ago

Quote SVN_REVISION value in Makefiles to guard against
possible svnversion command output with spaces.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1#
2#   Copyright (C) 2005 Clozure Associates and contributors.
3#   This file is part of Clozure CL. 
4#
5#   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
6#   License , known as the LLGPL and distributed with Clozure CL as the
7#   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
8#   which is distributed with Clozure CL as the file "LGPL".  Where these
9#   conflict, the preamble takes precedence. 
10#
11#   Clozure CL is referenced in the preamble as the "LIBRARY."
12#
13#   The LLGPL is also available online at
14#   http://opensource.franz.com/preamble.html
15
16
17SVN_REVISION := "$(shell svnversion || echo unknown)"
18
19SDKROOT=/
20OSVERSION=10.5
21
22MDYNAMIC_NO_PIC = $(shell ($(CC) --help -v 2>&1 | grep -q -e "-mdynamic-no-pic") && /bin/echo "-mdynamic-no-pic")
23
24
25VPATH = ..
26RM = /bin/rm
27CC=cc
28
29### Current ld64 bugs include the claim that 0x1000 isn't a power of 2.
30### Gosh.  I always thought that it was.  Go know, right ?
31LDFLAGS = -macosx_version_min $(OSVERSION) -arch x86_64 -dynamic \
32          -o $@ -e start -pagezero_size 0x11000 -seg1addr 0x00011000 \
33          -exported_symbols_list exports
34
35AS = as
36M4 = gm4
37###
38### DARWIN_GS_HACK enables some awful, dangerous, and slow workarounds
39### for the fact that early versions of x86-64 Darwin don't provide
40### working mechanisms for threads to address thread-local-data
41### relative to a spare segment register.  We instead use the
42### undocumented mechanism which the pthreads library uses to
43### keep pthread data in %gs, and switch %gs between pthread data
44### when running foreign code and lisp tcr data when running lisp
45### code.  Hopefully, we won't have to do this for very long.
46###
47### (Things like i386_set_ldt() are defined, but not implemented
48### correctly on the libc side and not implemented at all on the
49### Mach kernel side.)
50###
51### Apple never
52M4FLAGS = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR
53ASFLAGS = -arch x86_64 -g
54CDEFINES = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR -DSVN_REVISION=$(SVN_REVISION) \
55           -D_DARWIN_NO_64_BIT_INODE -DUSE_DTRACE
56CDEBUG = -g
57COPT = -O2
58# Once in a while, -Wformat says something useful.  The odds are against that,
59# however.
60WFORMAT = -Wno-format
61PLATFORM_H = platform-darwinx8664.h
62
63.s.o:
64        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
65.c.o:
66        $(CC) -include ../$(PLATFORM_H) -c $< -arch x86_64 $(CDEFINES) \
67        $(CDEBUG) $(COPT) $(WFORMAT) $(MDYNAMIC_NO_PIC) \
68         -I. -mmacosx-version-min=$(OSVERSION) -isysroot $(SDKROOT) -o $@
69
70SPOBJ = x86-spjump64.o x86-spentry64.o x86-subprims64.o
71ASMOBJ = x86-asmutils64.o imports.o
72
73COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
74        x86-utils.o \
75        thread_manager.o lisp-debug.o image.o memory.o unix-calls.o \
76        mach-o-image.o
77
78DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
79KERNELOBJ= imports.o $(COBJ) x86-asmutils64.o
80
81SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
82        x86-constants64.s
83
84CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
85        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
86        threads.h lisptypes.h x86-constants64.h x86-exceptions.h \
87        x86-utils.h \
88        $(PLATFORM_H) constants.h os-darwin.h
89
90# Subprims linked into the kernel ?
91# Yes:
92
93KSPOBJ= $(SPOBJ)
94all:    ../../dx86cl64
95
96
97# No:
98
99# KSPOBJ=
100
101OSEARLYLIBS = -lcrt1.o
102OSLATELIBS = -lSystem
103
104OSMIDDLELIBS = 
105
106
107OSLIBS = $(OSEARLYLIBS) $(OSMIDDLELIBS) $(OSLATELIBS)
108
109../../dx86cl64:  $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
110        $(LD) $(LDFLAGS) $(KSPOBJ) $(KERNELOBJ)  $(DEBUGOBJ) $(OSLIBS)
111
112
113$(SPOBJ): $(SPINC)
114$(ASMOBJ): $(SPINC)
115$(COBJ): $(CHEADERS) probes.h
116$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
117
118probes.h: probes.d
119        dtrace -h -s $<
120
121thread_manager.o: thread_manager.c
122
123cclean:
124        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../dx86cl64
125
126# Some earlier versions of this Makefile built "subprims_r.o". 
127# (That file is now defunct.)
128clean:  cclean
129        $(RM) -f $(SPOBJ) $(KSPOBJ) subprims_r.o
130
131strip:  ../../dx86cl64
132        strip -s retain ../../dx86cl64
133
Note: See TracBrowser for help on using the repository browser.