1 | # |
---|
2 | # Copyright (C) 2005 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 | |
---|
17 | VPATH = ../ |
---|
18 | RM = /bin/rm |
---|
19 | AS = as |
---|
20 | M4 = m4 |
---|
21 | ASFLAGS = --64 |
---|
22 | M4FLAGS = -DLINUX -DX86 -DX8664 -DHAVE_TLS |
---|
23 | CDEFINES = -DLINUX -D_REENTRANT -DX86 -DX8664 -D_GNU_SOURCE -DHAVE_TLS -DUSE_FUTEX #-DDISABLE_EGC |
---|
24 | CDEBUG = -g |
---|
25 | COPT = -O2 |
---|
26 | # Once in a while, -Wformat says something useful. The odds are against that, |
---|
27 | # however. |
---|
28 | WFORMAT = -Wno-format |
---|
29 | |
---|
30 | # If the linker supports a "--hash-style=" option, use traditional |
---|
31 | # SysV hash tables. (If it doesn't support that option, assume |
---|
32 | # that traditional hash tables will be used by default.) |
---|
33 | ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=") |
---|
34 | ifeq ($(ld_has_hash_style),) |
---|
35 | HASH_STYLE= |
---|
36 | else |
---|
37 | HASH_STYLE="-Wl,--hash-style=sysv" |
---|
38 | endif |
---|
39 | |
---|
40 | |
---|
41 | .s.o: |
---|
42 | $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@ |
---|
43 | .c.o: |
---|
44 | $(CC) -I./ -c $< $(CDEFINES) $(CDEBUG) $(COPT) $(WFORMAT) -m64 -o $@ |
---|
45 | |
---|
46 | SPOBJ = pad.o x86-spjump64.o x86-spentry64.o x86-subprims64.o |
---|
47 | ASMOBJ = x86-asmutils64.o imports.o |
---|
48 | |
---|
49 | COBJ = pmcl-kernel.o gc-common.o x86-gc.o bits.o x86-exceptions.o \ |
---|
50 | image.o thread_manager.o lisp-debug.o memory.o unix-calls.o |
---|
51 | |
---|
52 | DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o |
---|
53 | KERNELOBJ= $(COBJ) x86-asmutils64.o imports.o |
---|
54 | |
---|
55 | SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \ |
---|
56 | x86-constants64.s |
---|
57 | |
---|
58 | CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \ |
---|
59 | lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ |
---|
60 | Threads.h x86-constants64.h x86-exceptions.h lisptypes.h |
---|
61 | |
---|
62 | |
---|
63 | KSPOBJ = $(SPOBJ) |
---|
64 | all: ../../lx86cl64 |
---|
65 | |
---|
66 | |
---|
67 | OSLIBS = -ldl -lm -lpthread |
---|
68 | LINK_MAP = ./elf_x86_64.x |
---|
69 | USE_LINK_MAP = # -T ./elf_x86_64.x |
---|
70 | |
---|
71 | ../../lx86cl64: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile $(LINK_MAP) |
---|
72 | $(CC) -m64 $(CDEBUG) -Wl,--export-dynamic $(HASH_STYLE) -o $@ $(USE_LINK_MAP) $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS) |
---|
73 | |
---|
74 | |
---|
75 | $(SPOBJ): $(SPINC) |
---|
76 | $(ASMOBJ): $(SPINC) |
---|
77 | $(COBJ): $(CHEADERS) |
---|
78 | $(DEBUGOBJ): $(CHEADERS) lispdcmd.h |
---|
79 | |
---|
80 | |
---|
81 | cclean: |
---|
82 | $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../lx86cl64 |
---|
83 | |
---|
84 | clean: cclean |
---|
85 | $(RM) -f $(SPOBJ) |
---|
86 | |
---|
87 | strip: ../../lx86cl64 |
---|
88 | strip -g ../../lx86cl64 |
---|