source: branches/working-0711/ccl/lisp-kernel/darwinppc64/Makefile @ 7650

Last change on this file since 7650 was 7650, checked in by gb, 12 years ago

Add -mmacosx-version-min=10.3.9

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 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# For versions of GCC prior to 3.3, the option "-traditional-cpp" meant
18# "don't use precompiled headers", which was good advice since they didn't
19# work too well.  Beginning with GCC 3.3, the "-traditional-cpp" means
20# "use a broken preprocessor", which is (in a sense) the opposite of what
21# it used to mean.
22
23# Try to determine the version of GCC in use.  Invoke gcc with the
24# -v flag, and look for a line containing the phrase "specs from" in
25# the output.  Use sed to extract the full pathname of ths specs file
26# printed in that line, then strip off the trailing "/specs".
27gccdir = $(shell $(CC) -v 2>&1 | grep "specs from" | sed -e 's/.*from //' -e 's|/specs||')
28# $(gccdir) is set to the directory containing the specs file, without the
29# trailing slash.  The make intrinsic 'notdir' will strip a leading directory
30# prefix from that pathname, leaving us with a string that should match
31# the gcc version number
32#gccversion:=$(notdir $(gccdir))
33#oldgcc:=$(shell expr $(gccversion) "<" "3.3")
34#ifeq ($(oldgcc),1)
35#BROKEN_PREPROCESSOR_WORKAROUND = -traditional-cpp
36#endif
37
38MDYNAMIC_NO_PIC = $(shell ($(CC) --help -v 2>&1 | grep -q -e "-mdynamic-no-pic") && /bin/echo "-mdynamic-no-pic")
39
40OPENMCL_MAJOR_VERSION=0
41OPENMCL_MINOR_VERSION=14
42
43VPATH = ..
44RM = /bin/rm
45LD = ld64
46
47### The -pagezero_size/-seg1addr args are an attempt to work around a
48### bug (#4057702) in ld64.
49
50### The -seg1addr and -pagezero_size arguments below are nonsense;
51### early versions of ld64 were/are broken.
52LDFLAGS = -M -arch ppc64 -dynamic  -o $@ -e start -pagezero_size 0x1000 -seg1addr 0x1000 -sectalign __TEXT __text 0x1000
53AS = as
54M4 = gm4
55M4FLAGS = -DDARWIN -DPPC -DPPC64
56ASFLAGS = -arch ppc64
57CDEFINES = -DDARWIN -DPPC -DPPC64 $(BROKEN_PREPROCESSOR_WORKAROUND)
58CDEBUG = -g
59COPT = #-O2
60
61.s.o:
62        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
63.c.o:
64        $(CC) -c  $< -arch ppc64 -m64 $(CDEFINES) $(CDEBUG) $(COPT) $(MDYNAMIC_NO_PIC) -mmacosx-version-min=10.3.9 -o $@
65
66SPOBJ = ppc-spjump.o ppc-spentry.o ppc-subprims.o
67ASMOBJ = ppc-asmutils.o imports.o
68
69COBJ  = pmcl-kernel.o gc-common.o ppc-gc.o bits.o  ppc-exceptions.o \
70        thread_manager.o lisp-debug.o image.o memory.o
71
72DEBUGOBJ = lispdcmd.o plprint.o plsym.o plbt.o ppc_print.o
73KERNELOBJ= imports.o $(COBJ) ppc-asmutils.o
74
75SPINC = lisp.s m4macros.m4 ppc-constants.s ppc-macros.s errors.s ppc-uuo.s \
76        ppc-constants64.s
77
78CHEADERS = area.h bits.h ppc-constants.h lisp-errors.h gc.h lisp.h \
79        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
80        Threads.h lisptypes.h ppc-constants64.h ppc-exceptions.h
81
82# Subprims linked into the kernel ?
83# Yes:
84
85KSPOBJ= $(SPOBJ)
86all:    ../../dppccl64
87
88
89# No:
90
91# KSPOBJ=
92
93OSEARLYLIBS = -lcrt1.o
94OSLATELIBS = -lSystem -lmx
95
96# If the linker can find an absolute path to -lSystemStubs, use
97# -lSystemStubs; otherwise, just use libgcc.a
98SYSTEMSTUBSPATH = $(shell $(CC) --print-file-name=libSystemStubs.a)
99SYSTEMSTUBSABSOLUTE = $(shell expr $(SYSTEMSTUBSPATH) : "^/*")
100ifeq ($(SYSTEMSTUBSABSOLUTE),1)
101OSMIDDLELIBS = -lSystemStubs
102else
103OSMIDDLELIBS = -lgcc
104endif
105
106OSLIBS = $(OSEARLYLIBS) $(OSMIDDLELIBS) $(OSLATELIBS)
107
108../../dppccl64:  $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
109        $(LD)  $(LDFLAGS) $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)   $(OSLIBS)
110
111
112$(SPOBJ): $(SPINC)
113$(ASMOBJ): $(SPINC)
114$(COBJ): $(CHEADERS)
115$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
116
117
118thread_manager.o: thread_manager.c
119
120cclean:
121        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../dppccl64
122
123# Some earlier versions of this Makefile built "subprims_r.o". 
124# (That file is now defunct.)
125clean:  cclean
126        $(RM) -f $(SPOBJ) $(KSPOBJ) subprims_r.o
127
128strip:  ../../dppccl64
129        strip -s retain ../../dppccl64
Note: See TracBrowser for help on using the repository browser.