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". |
---|
27 | gccdir = $(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 | |
---|
38 | MDYNAMIC_NO_PIC = $(shell ($(CC) --help -v 2>&1 | grep -q -e "-mdynamic-no-pic") && /bin/echo "-mdynamic-no-pic") |
---|
39 | |
---|
40 | OPENMCL_MAJOR_VERSION=0 |
---|
41 | OPENMCL_MINOR_VERSION=14 |
---|
42 | |
---|
43 | VPATH = .. |
---|
44 | RM = /bin/rm |
---|
45 | LD = ld |
---|
46 | LDFLAGS = -arch ppc -dynamic -o $@ -e start -seg1addr 0x00003000 -sectalign __TEXT __text 0x1000 -pagezero_size 0x3000 |
---|
47 | # -stack_addr 0xC0000000 -stack_size 0x00100000 |
---|
48 | AS = as |
---|
49 | M4 = gm4 |
---|
50 | M4FLAGS = -DDARWIN |
---|
51 | ASFLAGS = -force_cpusubtype_ALL |
---|
52 | CDEFINES = -DDARWIN $(BROKEN_PREPROCESSOR_WORKAROUND) -DOPENMCL_MAJOR_VERSION=$(OPENMCL_MAJOR_VERSION) -DOPENMCL_MINOR_VERSION=$(OPENMCL_MINOR_VERSION) |
---|
53 | CDEBUG = -g |
---|
54 | COPT = #-O2 |
---|
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 | |
---|
61 | SPOBJ = spjump.o spentry.o subprims.o |
---|
62 | ASMOBJ = asmutils.o imports.o |
---|
63 | |
---|
64 | COBJ = pmcl-kernel.o gc.o bits.o lisp-exceptions.o \ |
---|
65 | thread_manager.o lisp-debug.o image.o |
---|
66 | |
---|
67 | DEBUGOBJ = lispdcmd.o plprint.o plsym.o plbt.o ppc_print.o |
---|
68 | KERNELOBJ= imports.o $(COBJ) asmutils.o |
---|
69 | |
---|
70 | SPINC = lisp.s m4macros.m4 constants.s macros.s errors.s uuo.s |
---|
71 | |
---|
72 | CHEADERS = 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 | |
---|
79 | KSPOBJ= $(SPOBJ) |
---|
80 | all: ../../dppccl |
---|
81 | |
---|
82 | |
---|
83 | # No: |
---|
84 | |
---|
85 | # KSPOBJ= |
---|
86 | # all: ../../ppccl ../../subprims.so |
---|
87 | |
---|
88 | OSLIBS = -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 |
---|
95 | SAMPLER_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 | |
---|
110 | MAGIC_PADDING_VALUE=4544 |
---|
111 | pad.o: ../pad.s |
---|
112 | $(M4) -DMAGIC_PADDING_VALUE=$(MAGIC_PADDING_VALUE) $< | as -o $@ |
---|
113 | |
---|
114 | thread_manager.o: thread_manager.c |
---|
115 | |
---|
116 | cclean: |
---|
117 | $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../dppccl |
---|
118 | |
---|
119 | # Some earlier versions of this Makefile built "subprims_r.o". |
---|
120 | # (That file is now defunct.) |
---|
121 | clean: cclean |
---|
122 | $(RM) -f $(SPOBJ) $(KSPOBJ) subprims_r.o |
---|
123 | |
---|
124 | strip: ../../dppccl |
---|
125 | strip -s retain ../../dppccl |
---|