source: branches/ide-1.0/ccl/lisp-kernel/darwinx8664/Makefile @ 6566

Last change on this file since 6566 was 6566, checked in by gb, 13 years ago

populate

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1#
2#   Copyright (C) 2005 Clozure Associates and contributors.
3#   This file is part of OpenMCL. 
4#
5#   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
6#   License , known as the LLGPL and distributed with OpenMCL as the
7#   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
8#   which is distributed with OpenMCL as the file "LGPL".  Where these
9#   conflict, the preamble takes precedence. 
10#
11#   OpenMCL 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 = ld64
25
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 = -arch x86_64 -dynamic  -o $@ -e start -pagezero_size 0x1000 -seg1addr 0x00001000
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###
48M4FLAGS = -DDARWIN -DX86 -DX8664 -DDARWIN_GS_HACK
49ASFLAGS = -arch x86_64 -g
50CDEFINES = -DDARWIN -DX86 -DX8664 -DDARWIN_GS_HACK
51CDEBUG = -g
52COPT = #-O2
53
54.s.o:
55        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
56.c.o:
57        $(CC) -c $< -arch x86_64 -m64 $(CDEFINES) $(CDEBUG) $(COPT) $(MDYNAMIC_NO_PIC) -o $@
58
59SPOBJ = x86-spjump64.o x86-spentry64.o x86-subprims64.o
60ASMOBJ = x86-asmutils64.o imports.o
61
62COBJ  = pmcl-kernel.o x86-gc.o bits.o  x86-exceptions.o \
63        thread_manager.o lisp-debug.o image.o memory.o
64
65DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
66KERNELOBJ= imports.o $(COBJ) x86-asmutils64.o
67
68SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
69        x86-constants64.s
70
71CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
72        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
73        Threads.h lisptypes.h x86-constants64.h x86-exceptions.h
74
75# Subprims linked into the kernel ?
76# Yes:
77
78KSPOBJ= $(SPOBJ)
79all:    ../../dx86cl64
80
81
82# No:
83
84# KSPOBJ=
85
86OSEARLYLIBS = -lcrt1.o
87OSLATELIBS = -lSystem
88
89OSMIDDLELIBS = 
90
91
92OSLIBS = $(OSEARLYLIBS) $(OSMIDDLELIBS) $(OSLATELIBS)
93
94../../dx86cl64:  $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
95        $(LD) $(LDFLAGS) $(KSPOBJ) $(KERNELOBJ)  $(DEBUGOBJ) $(OSLIBS)
96
97
98$(SPOBJ): $(SPINC)
99$(ASMOBJ): $(SPINC)
100$(COBJ): $(CHEADERS)
101$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
102
103
104thread_manager.o: thread_manager.c
105
106cclean:
107        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../dx86cl64
108
109# Some earlier versions of this Makefile built "subprims_r.o". 
110# (That file is now defunct.)
111clean:  cclean
112        $(RM) -f $(SPOBJ) $(KSPOBJ) subprims_r.o
113
114strip:  ../../dx86cl64
115        strip -s retain ../../dx86cl64
Note: See TracBrowser for help on using the repository browser.