1 | # |
---|
2 | # Copyright (C) 2010 Clozure Associates |
---|
3 | # This file is part of Clozure CL. |
---|
4 | # |
---|
5 | # Clozure CL is licensed under the terms of the Lisp Lesser GNU Public |
---|
6 | # License , known as the LLGPL and distributed with Clozure CL as the |
---|
7 | # file "LICENSE". The LLGPL consists of a preamble and the LGPL, |
---|
8 | # which is distributed with Clozure CL as the file "LGPL". Where these |
---|
9 | # conflict, the preamble takes precedence. |
---|
10 | # |
---|
11 | # Clozure CL 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 | SVN_REVISION := "$(shell svnversion || echo unknown)" |
---|
17 | |
---|
18 | VPATH = ../ |
---|
19 | RM = /bin/rm |
---|
20 | # Versions of GNU as >= 2.9.1 all seem to work |
---|
21 | # AS = gas-2.9.1 |
---|
22 | AS = as |
---|
23 | M4 = m4 |
---|
24 | ASFLAGS = -mfpu=vfp -march=armv7-a |
---|
25 | M4FLAGS = -DLINUX -DARM |
---|
26 | CDEFINES = -DLINUX -DARM -D_REENTRANT -D_GNU_SOURCE -DUSE_FUTEX -DSVN_REVISION=$(SVN_REVISION) |
---|
27 | CDEBUG = -g |
---|
28 | COPT = -O2 |
---|
29 | # Once in a while, -Wformat says something useful. The odds are against that, |
---|
30 | # however. |
---|
31 | WFORMAT = -Wno-format |
---|
32 | PLATFORM_H = platform-linuxarm.h |
---|
33 | |
---|
34 | # If the linker supports a "--hash-style=" option, use traditional |
---|
35 | # Sysv hash tables. (If it doesn't support that option, assume |
---|
36 | # that traditional hash tables will be used by default.) |
---|
37 | ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=") |
---|
38 | ifeq ($(ld_has_hash_style),) |
---|
39 | HASH_STYLE= |
---|
40 | else |
---|
41 | HASH_STYLE="-Wl,--hash-style=sysv" |
---|
42 | endif |
---|
43 | |
---|
44 | |
---|
45 | # Likewise, some versions of GAS may need a "-a32" flag, to force the |
---|
46 | |
---|
47 | # output file to be 32-bit compatible. |
---|
48 | |
---|
49 | A32 = $(shell ($(AS) --help -v 2>&1 | grep -q -e "-a32") && /bin/echo "-a32") |
---|
50 | |
---|
51 | .s.o: |
---|
52 | $(M4) $(M4FLAGS) -I../ $< | $(AS) $(A32) $(ASFLAGS) -o $@ |
---|
53 | .c.o: |
---|
54 | $(CC) -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) -marm $(WFORMAT) -o $@ |
---|
55 | |
---|
56 | SPOBJ = pad.o arm-spentry.o |
---|
57 | ASMOBJ = arm-asmutils.o imports.o |
---|
58 | |
---|
59 | COBJ = pmcl-kernel.o gc-common.o arm-gc.o bits.o arm-exceptions.o \ |
---|
60 | image.o thread_manager.o lisp-debug.o memory.o unix-calls.o |
---|
61 | |
---|
62 | DEBUGOBJ = lispdcmd.o plprint.o plsym.o albt.o arm_print.o |
---|
63 | KERNELOBJ= $(COBJ) arm-asmutils.o imports.o |
---|
64 | |
---|
65 | SPINC = lisp.s m4macros.m4 arm-constants.s arm-macros.s errors.s arm-uuo.s \ |
---|
66 | lisp_globals.s |
---|
67 | |
---|
68 | CHEADERS = area.h bits.h arm-constants.h lisp-errors.h gc.h lisp.h \ |
---|
69 | lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ |
---|
70 | threads.h arm-exceptions.h $(PLATFORM_H) |
---|
71 | |
---|
72 | # Subprims linked into the kernel ? |
---|
73 | # Yes: |
---|
74 | |
---|
75 | KSPOBJ = $(SPOBJ) |
---|
76 | all: ../../armcl |
---|
77 | |
---|
78 | |
---|
79 | # No: |
---|
80 | |
---|
81 | # KSPOBJ= |
---|
82 | # all: ../../ppccl ../../subprims.so |
---|
83 | |
---|
84 | OSLIBS = -ldl -lm -lpthread |
---|
85 | |
---|
86 | |
---|
87 | ../../armcl: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) |
---|
88 | $(CC) $(CDEBUG) -Wl,--export-dynamic $(HASH_STYLE) -o $@ -T ./armlinux.x $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) -Wl,--no-as-needed $(OSLIBS) |
---|
89 | |
---|
90 | |
---|
91 | $(SPOBJ): $(SPINC) |
---|
92 | $(ASMOBJ): $(SPINC) |
---|
93 | $(COBJ): $(CHEADERS) |
---|
94 | $(DEBUGOBJ): $(CHEADERS) lispdcmd.h |
---|
95 | |
---|
96 | |
---|
97 | cclean: |
---|
98 | $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../ppccl |
---|
99 | |
---|
100 | clean: cclean |
---|
101 | $(RM) -f $(SPOBJ) |
---|
102 | |
---|
103 | strip: ../../ppccl |
---|
104 | strip -g ../../ppccl |
---|