source: trunk/ccl/lisp-kernel/pantherg5/Makefile @ 530

Last change on this file since 530 was 530, checked in by gb, 16 years ago

Start to conditionalize for PPC64, almost.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1#
2#   Copyright (C) 1994-2001 Digitool, Inc
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
32gccversion:=$(notdir $(gccdir))
33oldgcc:=$(shell expr $(gccversion) "<" "3.3")
34ifeq ($(oldgcc),1)
35BROKEN_PREPROCESSOR_WORKAROUND = -traditional-cpp
36endif
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 = ld
46LDFLAGS = -arch ppc -dynamic  -o $@ -e start -seg1addr 0x00003000 -sectalign __TEXT __text 0x1000 -pagezero_size 0x3000
47# -stack_addr 0xC0000000 -stack_size 0x00100000
48AS = as
49M4 = gm4
50M4FLAGS = -DDARWIN -DPPC64 -DPANTHERG5
51ASFLAGS = -force_cpusubtype_ALL
52CDEFINES = -DDARWIN $(BROKEN_PREPROCESSOR_WORKAROUND) -DOPENMCL_MAJOR_VERSION=$(OPENMCL_MAJOR_VERSION) -DOPENMCL_MINOR_VERSION=$(OPENMCL_MINOR_VERSION) 
53CDEBUG = -g
54COPT = -O2 -mpowerpc64 -DPPC64 -DPANTHERG5
55
56.s.o:
57        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
58.c.o:
59        $(CC) -c $< $(CDEFINES) $(CDEBUG) $(COPT) $(MDYNAMIC_NO_PIC) -o $@
60
61SPOBJ = spjump.o spentry.o  subprims.o
62ASMOBJ = asmutils.o imports.o
63
64COBJ  = pmcl-kernel.o gc.o bits.o  lisp-exceptions.o \
65        thread_manager.o lisp-debug.o image.o
66
67DEBUGOBJ = lispdcmd.o plprint.o plsym.o plbt.o ppc_print.o
68KERNELOBJ= imports.o $(COBJ) asmutils.o
69
70SPINC = lisp.s m4macros.m4 constants.s macros.s errors.s uuo.s
71
72CHEADERS = area.h bits.h constants.h lisp-errors.h gc.h lisp.h \
73        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
74        Threads.h
75
76# Subprims linked into the kernel ?
77# Yes:
78
79KSPOBJ= $(SPOBJ)
80all:    ../../dppccl
81
82
83# No:
84
85# KSPOBJ=
86# all:  ../../ppccl ../../subprims.so
87
88OSLIBS = -lcrt1.o -lcc_dynamic -lSystem
89
90
91../../dppccl:    $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)
92        $(LD)  $(LDFLAGS) $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)   $(OSLIBS)
93
94# Can leave this unset when compiling on/for Jaguar
95SAMPLER_ARCH_DEFINES=-DUSE_MACH
96
97../../darwin_sampler.so: sampler.c
98        $(CC) -bundle  $< $(CDEFINES) $(SAMPLER_ARCH_DEFINES) $(CDEBUG) $(COPT) -o $@
99
100# This will fail to compile on pre-Jaguar systems
101../../jaguar_sampler.so: sampler.c
102        $(CC) -bundle  $< $(CDEFINES)  $(CDEBUG) $(COPT) -o $@
103
104$(SPOBJ): $(SPINC)
105$(ASMOBJ): $(SPINC)
106$(COBJ): $(CHEADERS)
107$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
108
109
110MAGIC_PADDING_VALUE=4544
111pad.o:  ../pad.s
112        $(M4) -DMAGIC_PADDING_VALUE=$(MAGIC_PADDING_VALUE) $< | as -o $@
113
114thread_manager.o: thread_manager.c
115
116cclean:
117        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../dppccl
118
119# Some earlier versions of this Makefile built "subprims_r.o". 
120# (That file is now defunct.)
121clean:  cclean
122        $(RM) -f $(SPOBJ) $(KSPOBJ) subprims_r.o
123
124strip:  ../../dppccl
125        strip -s retain ../../dppccl
Note: See TracBrowser for help on using the repository browser.