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

Last change on this file was 16809, checked in by rme, 3 years ago

Use OSVERSION in the final link. Fixes ticket:1402.

Also remove the linker option to write a map file, which was for
debugging and should not have been checked in.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1#
2# Copyright 2005 Clozure Associates
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16SVN_REVISION := "$(shell svnversion || echo unknown)"
17
18OSVERSION=10.6
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=cc
26AS = as
27M4 = gm4
28
29M4FLAGS = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR
30ASFLAGS = -arch x86_64 -g
31
32# In Xcode 7, the clang integrated assember complains that .stabs
33# directives are unsupported.  Work around this by using the system
34# assembler.  (Apparently, we'll have to quit using .stabs directives
35# at some point soon.)
36
37# Since Xcode 7 only runs on Yosemite and later, use OS version as a
38# heuristic to detect whether the -Q flag is available.  It seems to
39# be available as far back as Lion, but on Snow Leopard, "as" doesn't
40# know about -Q.
41
42yosemite_plus := $(shell uname -r | awk -F. '{ if ($$1 >= 14) print "t" }')
43ifeq ($(yosemite_plus),t)
44ASFLAGS += -Q
45endif
46
47CDEFINES = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR -DSVN_REVISION=$(SVN_REVISION) \
48           -DUSE_DTRACE
49CDEBUG = -g
50COPT = -O
51# Once in a while, -Wformat says something useful.  The odds are against that,
52# however.
53WFORMAT = -Wno-format
54PLATFORM_H = platform-darwinx8664.h
55
56.s.o:
57        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
58.c.o:
59        $(CC) -include ../$(PLATFORM_H) -c $< -arch x86_64 $(CDEFINES) \
60        $(CDEBUG) $(COPT) $(WFORMAT) $(MDYNAMIC_NO_PIC) \
61         -I. -mmacosx-version-min=$(OSVERSION) -o $@
62
63SPOBJ = x86-spjump64.o x86-spentry64.o x86-subprims64.o
64ASMOBJ = x86-asmutils64.o imports.o
65
66COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
67        x86-utils.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 mach_exc_server.o
73
74SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
75        x86-constants64.s lisp_globals.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        x86-utils.h \
81        $(PLATFORM_H) constants.h os-darwin.h
82
83KSPOBJ= $(SPOBJ)
84all:    ../../dx86cl64
85
86../../dx86cl64:  $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
87        cc -mmacosx-version-min=$(OSVERSION) -arch x86_64 \
88         -Wl,-no_pie,-pagezero_size,0x11000,-seg1addr,0x11000 \
89         -o $@ $(SPOBJ) $(KERNELOBJ) $(DEBUGOBJ)
90
91$(SPOBJ): $(SPINC)
92$(ASMOBJ): $(SPINC)
93$(COBJ): $(CHEADERS) probes.h
94$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
95
96probes.h: probes.d
97        dtrace -h -s $<
98
99thread_manager.o: thread_manager.c
100
101mach_exc_server.o: mach_exc_server.c mach_exc.h
102
103mach_exc.h mach_exc_server.c: mach_exc.defs
104        mig -arch x86_64 -header /dev/null -user /dev/null \
105                -sheader mach_exc.h -server mach_exc_server.c \
106                 $<
107
108cclean:
109        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../dx86cl64
110
111# Some earlier versions of this Makefile built "subprims_r.o". 
112# (That file is now defunct.)
113clean:  cclean
114        $(RM) -f $(SPOBJ) $(KSPOBJ) subprims_r.o
115
116strip:  ../../dx86cl64
117        strip -s retain ../../dx86cl64
118
Note: See TracBrowser for help on using the repository browser.