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

Last change on this file since 14347 was 14347, checked in by rme, 9 years ago

Define SVN_REVISION in Linux and Darwin makefiles (x86, x86-64).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
RevLine 
[4943]1#
2#   Copyright (C) 2005 Clozure Associates and contributors.
[13066]3#   This file is part of Clozure CL. 
[4943]4#
[13066]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
[4943]7#   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
[13066]8#   which is distributed with Clozure CL as the file "LGPL".  Where these
[4943]9#   conflict, the preamble takes precedence. 
10#
[13066]11#   Clozure CL is referenced in the preamble as the "LIBRARY."
[4943]12#
13#   The LLGPL is also available online at
14#   http://opensource.franz.com/preamble.html
15
16
17
[14347]18SVN_REVISION=$(shell svnversion || echo "unknown")
[4943]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
[11912]25LD = ld
26CC=gcc-4.0
[4943]27
[5658]28### Current ld64 bugs include the claim that 0x1000 isn't a power of 2.
29### Gosh.  I always thought that it was.  Go know, right ?
[13403]30LDFLAGS = -macosx_version_min 10.5 -arch x86_64 -dynamic  -o $@ -e start -pagezero_size 0x11000 -seg1addr 0x00011000
[5658]31
32
[4943]33AS = as
34M4 = gm4
[4986]35###
36### DARWIN_GS_HACK enables some awful, dangerous, and slow workarounds
37### for the fact that early versions of x86-64 Darwin don't provide
38### working mechanisms for threads to address thread-local-data
39### relative to a spare segment register.  We instead use the
40### undocumented mechanism which the pthreads library uses to
41### keep pthread data in %gs, and switch %gs between pthread data
42### when running foreign code and lisp tcr data when running lisp
43### code.  Hopefully, we won't have to do this for very long.
44###
45### (Things like i386_set_ldt() are defined, but not implemented
46### correctly on the libc side and not implemented at all on the
47### Mach kernel side.)
48###
[12601]49### Apple never
50M4FLAGS = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR
[5034]51ASFLAGS = -arch x86_64 -g
[14347]52CDEFINES = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR -DSVN_REVISION=$(SVN_REVISION)
[4943]53CDEBUG = -g
[6034]54COPT = -O2
[13336]55# Once in a while, -Wformat says something useful.  The odds are against that,
56# however.
57WFORMAT = -Wno-format
[13600]58PLATFORM_H = platform-darwinx8664.h
[4943]59
60.s.o:
61        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
62.c.o:
[13600]63        $(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 $@
[4943]64
65SPOBJ = x86-spjump64.o x86-spentry64.o x86-subprims64.o
66ASMOBJ = x86-asmutils64.o imports.o
67
[7648]68COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
[10665]69        thread_manager.o lisp-debug.o image.o memory.o unix-calls.o
[4943]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 \
[14197]79        threads.h lisptypes.h x86-constants64.h x86-exceptions.h \
[13638]80        $(PLATFORM_H) constants.h os-darwin.h
[4943]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
[5002]94OSLATELIBS = -lSystem
[4943]95
[5002]96OSMIDDLELIBS = 
[4943]97
[5002]98
[4943]99OSLIBS = $(OSEARLYLIBS) $(OSMIDDLELIBS) $(OSLATELIBS)
100
[13403]101../../dx86cl64:  $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
[5034]102        $(LD) $(LDFLAGS) $(KSPOBJ) $(KERNELOBJ)  $(DEBUGOBJ) $(OSLIBS)
[4943]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
[13047]123
Note: See TracBrowser for help on using the repository browser.