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

Last change on this file since 14584 was 14584, checked in by gb, 9 years ago

mach-o-image.c: work-in-progress
darwinx86*/Makefile: add mach-o-image.o; at this point, just to

make it easier to tell if mach-o-image.c compiles/links.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 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
18SVN_REVISION=$(shell svnversion || echo "unknown")
19
20MDYNAMIC_NO_PIC = $(shell ($(CC) --help -v 2>&1 | grep -q -e "-mdynamic-no-pic") && /bin/echo "-mdynamic-no-pic")
21
22
23VPATH = ..
24RM = /bin/rm
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 -DSVN_REVISION=$(SVN_REVISION)
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        mach-o-image.o
70
71DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
72KERNELOBJ= imports.o $(COBJ) x86-asmutils64.o
73
74SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
75        x86-constants64.s
76
77CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
78        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
79        threads.h lisptypes.h x86-constants64.h x86-exceptions.h \
80        $(PLATFORM_H) constants.h os-darwin.h
81
82# Subprims linked into the kernel ?
83# Yes:
84
85KSPOBJ= $(SPOBJ)
86all:    ../../dx86cl64
87
88
89# No:
90
91# KSPOBJ=
92
93OSEARLYLIBS = -lcrt1.o
94OSLATELIBS = -lSystem
95
96OSMIDDLELIBS = 
97
98
99OSLIBS = $(OSEARLYLIBS) $(OSMIDDLELIBS) $(OSLATELIBS)
100
101../../dx86cl64:  $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
102        $(LD) $(LDFLAGS) $(KSPOBJ) $(KERNELOBJ)  $(DEBUGOBJ) $(OSLIBS)
103
104
105$(SPOBJ): $(SPINC)
106$(ASMOBJ): $(SPINC)
107$(COBJ): $(CHEADERS)
108$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
109
110
111thread_manager.o: thread_manager.c
112
113cclean:
114        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../dx86cl64
115
116# Some earlier versions of this Makefile built "subprims_r.o". 
117# (That file is now defunct.)
118clean:  cclean
119        $(RM) -f $(SPOBJ) $(KSPOBJ) subprims_r.o
120
121strip:  ../../dx86cl64
122        strip -s retain ../../dx86cl64
123
Note: See TracBrowser for help on using the repository browser.