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 | VPATH = ../ |
---|
18 | RM = /bin/rm |
---|
19 | # Versions of GNU as >= 2.9.1 all seem to work |
---|
20 | # AS = gas-2.9.1 |
---|
21 | AS = as |
---|
22 | M4 = m4 |
---|
23 | ASFLAGS = -mregnames -mppc64 -a64 -maltivec |
---|
24 | M4FLAGS = -DLINUX -DPPC -DPPC64 |
---|
25 | CDEFINES = -DLINUX -D_REENTRANT -DPPC -DPPC64 -D_GNU_SOURCE |
---|
26 | CDEBUG = -g |
---|
27 | COPT = -O2 |
---|
28 | # word size issues are a little more relevant on a 64-bit platform |
---|
29 | # than elsewhere, but most gcc format warnings are still nonsense. |
---|
30 | WFORMAT = -Wno-format |
---|
31 | |
---|
32 | # If the linker supports a "--hash-style=" option, use traditional |
---|
33 | # Sysv hash tables. (If it doesn't support that option, assume |
---|
34 | # that traditional hash tables will be used by default.) |
---|
35 | ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=") |
---|
36 | ifeq ($(ld_has_hash_style),) |
---|
37 | HASH_STYLE= |
---|
38 | else |
---|
39 | HASH_STYLE="-Wl,--hash-style=sysv" |
---|
40 | endif |
---|
41 | |
---|
42 | |
---|
43 | .s.o: |
---|
44 | $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@ |
---|
45 | .c.o: |
---|
46 | $(CC) -c $< $(CDEFINES) $(CDEBUG) $(COPT) $(WFORMAT) -m64 -o $@ |
---|
47 | |
---|
48 | SPOBJ = pad.o ppc-spjump.o ppc-spentry.o ppc-subprims.o |
---|
49 | ASMOBJ = ppc-asmutils.o imports.o |
---|
50 | |
---|
51 | COBJ = pmcl-kernel.o gc-common.o ppc-gc.o bits.o ppc-exceptions.o \ |
---|
52 | image.o thread_manager.o lisp-debug.o memory.o unix-calls.o |
---|
53 | |
---|
54 | DEBUGOBJ = lispdcmd.o plprint.o plsym.o plbt.o ppc_print.o |
---|
55 | KERNELOBJ= $(COBJ) ppc-asmutils.o imports.o |
---|
56 | |
---|
57 | SPINC = lisp.s m4macros.m4 ppc-constants.s ppc-macros.s errors.s ppc-uuo.s ppc-constants64.s |
---|
58 | |
---|
59 | CHEADERS = area.h bits.h ppc-constants.h lisp-errors.h gc.h lisp.h \ |
---|
60 | lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ |
---|
61 | Threads.h ppc-constants64.h ppc-exceptions.h |
---|
62 | |
---|
63 | # Subprims linked into the kernel ? |
---|
64 | # Yes: |
---|
65 | |
---|
66 | KSPOBJ = $(SPOBJ) |
---|
67 | all: ../../ppccl64 |
---|
68 | |
---|
69 | |
---|
70 | # No: |
---|
71 | |
---|
72 | # KSPOBJ= |
---|
73 | # all: ../../ppccl64 ../../subprims.so |
---|
74 | |
---|
75 | OSLIBS = -ldl -lm -lpthread |
---|
76 | |
---|
77 | |
---|
78 | ../../ppccl64: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) |
---|
79 | $(CC) -m64 $(CDEBUG) -Wl,--export-dynamic $(HASH_STYLE) -o $@ -T ./elf64ppc.x $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS) |
---|
80 | |
---|
81 | |
---|
82 | $(SPOBJ): $(SPINC) |
---|
83 | $(ASMOBJ): $(SPINC) |
---|
84 | $(COBJ): $(CHEADERS) |
---|
85 | $(DEBUGOBJ): $(CHEADERS) lispdcmd.h |
---|
86 | |
---|
87 | |
---|
88 | cclean: |
---|
89 | $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../ppccl64 |
---|
90 | |
---|
91 | clean: cclean |
---|
92 | $(RM) -f $(SPOBJ) |
---|
93 | |
---|
94 | strip: ../../ppccl64 |
---|
95 | strip -g ../../ppccl64 |
---|