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

Last change on this file since 13600 was 13600, checked in by gb, 10 years ago

Define PLATFORM_H, force its inclusion via -include. (This needs to be
done on other platforms as well; so far, only darwinx86 has been tested
at all.)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 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
17
18
19MDYNAMIC_NO_PIC = $(shell ($(CC) --help -v 2>&1 | grep -q -e "-mdynamic-no-pic") && /bin/echo "-mdynamic-no-pic")
20
21
22VPATH = ..
23RM = /bin/rm
24LD = ld
25CC=gcc-4.0
26
27### Current ld64 bugs include the claim that 0x1000 isn't a power of 2.
28### Gosh.  I always thought that it was.  Go know, right ?
29LDFLAGS = -macosx_version_min 10.5 -arch x86_64 -dynamic  -o $@ -e start -pagezero_size 0x11000 -seg1addr 0x00011000
30
31
32AS = as
33M4 = gm4
34###
35### DARWIN_GS_HACK enables some awful, dangerous, and slow workarounds
36### for the fact that early versions of x86-64 Darwin don't provide
37### working mechanisms for threads to address thread-local-data
38### relative to a spare segment register.  We instead use the
39### undocumented mechanism which the pthreads library uses to
40### keep pthread data in %gs, and switch %gs between pthread data
41### when running foreign code and lisp tcr data when running lisp
42### code.  Hopefully, we won't have to do this for very long.
43###
44### (Things like i386_set_ldt() are defined, but not implemented
45### correctly on the libc side and not implemented at all on the
46### Mach kernel side.)
47###
48### Apple never
49M4FLAGS = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR
50ASFLAGS = -arch x86_64 -g
51CDEFINES = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR
52CDEBUG = -g
53COPT = -O2
54# Once in a while, -Wformat says something useful.  The odds are against that,
55# however.
56WFORMAT = -Wno-format
57PLATFORM_H = platform-darwinx8664.h
58
59.s.o:
60        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
61.c.o:
62        $(CC) -include ../$(PLATFORM_H) -c $< -arch x86_64 $(CDEFINES) $(CDEBUG) $(COPT) $(WFORMAT) $(MDYNAMIC_NO_PIC) -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -o $@
63
64SPOBJ = x86-spjump64.o x86-spentry64.o x86-subprims64.o
65ASMOBJ = x86-asmutils64.o imports.o
66
67COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
68        thread_manager.o lisp-debug.o image.o memory.o unix-calls.o
69
70DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
71KERNELOBJ= imports.o $(COBJ) x86-asmutils64.o
72
73SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
74        x86-constants64.s
75
76CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
77        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
78        Threads.h lisptypes.h x86-constants64.h x86-exceptions.h $(PLATFORM_H)
79
80# Subprims linked into the kernel ?
81# Yes:
82
83KSPOBJ= $(SPOBJ)
84all:    ../../dx86cl64
85
86
87# No:
88
89# KSPOBJ=
90
91OSEARLYLIBS = -lcrt1.o
92OSLATELIBS = -lSystem
93
94OSMIDDLELIBS = 
95
96
97OSLIBS = $(OSEARLYLIBS) $(OSMIDDLELIBS) $(OSLATELIBS)
98
99../../dx86cl64:  $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
100        $(LD) $(LDFLAGS) $(KSPOBJ) $(KERNELOBJ)  $(DEBUGOBJ) $(OSLIBS)
101
102
103$(SPOBJ): $(SPINC)
104$(ASMOBJ): $(SPINC)
105$(COBJ): $(CHEADERS)
106$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
107
108
109thread_manager.o: thread_manager.c
110
111cclean:
112        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../dx86cl64
113
114# Some earlier versions of this Makefile built "subprims_r.o". 
115# (That file is now defunct.)
116clean:  cclean
117        $(RM) -f $(SPOBJ) $(KSPOBJ) subprims_r.o
118
119strip:  ../../dx86cl64
120        strip -s retain ../../dx86cl64
121
Note: See TracBrowser for help on using the repository browser.