source: trunk/source/lisp-kernel/androidarm/Makefile @ 15197

Last change on this file since 15197 was 15197, checked in by gb, 8 years ago

Rename one of the recently-renamed nil-relative symbols again.

Move all of the nrs definitions from lisp-kernel/*constants*.s
to a new file (lisp_globals.s) which should make this a little
easiser in the future. (see also compiler/*/*-arch.lisp).

Add lisp_globals.s as a dependency in (some) Makefiles; will
get the others in a minute.

(Builds on x8632/64; other archs not yet tested.)

File size: 3.6 KB
Line 
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
16LIBBASE = 0x04001000
17NDK = /usr/local/android-ndk-r7
18HOST = darwin-x86
19ANDROIDVERSION = android-9
20SYSROOT = $(NDK)/platforms/$(ANDROIDVERSION)/arch-arm
21NDKLIB = $(SYSROOT)/usr/lib
22NDKINC = $(SYSROOT)/usr/include
23ABI = arm-linux-androideabi
24NDKBIN = $(NDK)/toolchains/$(ABI)-4.4.3/prebuilt/$(HOST)/bin/$(ABI)-
25VPATH = ../
26RM = /bin/rm
27AS = $(NDKBIN)as
28CC = $(NDKBIN)gcc --sysroot $(SYSROOT)
29LD = $(NDKBIN)ld
30HOSTCC = cc -m32
31M4 = m4
32ASFLAGS = -mfpu=vfp
33M4FLAGS = -DLINUX -DARM -DANDROID -DLIBBASE=$(LIBBASE)
34CDEFINES = -DLINUX -DARM -DANDROID -D_REENTRANT -D_GNU_SOURCE -DUSE_FUTEX -DCCLSHARED
35CDEBUG = -g
36COPT = #-O2
37# Once in a while, -Wformat says something useful.  The odds are against that,
38# however.
39WFORMAT = -Wno-format
40PLATFORM_H = platform-androidarm.h
41
42# If the linker supports a "--hash-style=" option, use traditional
43# Sysv hash tables.  (If it doesn't support that option, assume
44# that traditional hash tables will be used by default.)
45ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=")
46ifeq ($(ld_has_hash_style),)
47HASH_STYLE=
48else
49HASH_STYLE="-Wl,--hash-style=sysv"
50endif
51
52
53
54.s.o:
55        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
56.c.o:
57        $(CC) -include ../$(PLATFORM_H) -I. -I$(NDKINC) -c $<  $(CDEFINES) $(CDEBUG) $(COPT) $(WFORMAT) -fpic -o $@
58
59
60# -nostdinc -isystem ${NDK}/usr/gcc-include -isystem $(NDK)/usr/include
61SPOBJ = pad.o  arm-spentry.o
62#arm-subprims.o
63ASMOBJ = arm-asmutils.o imports.o
64
65COBJ  = pmcl-kernel.o gc-common.o arm-gc.o bits.o  arm-exceptions.o \
66        image.o thread_manager.o lisp-debug.o memory.o unix-calls.o
67
68DEBUGOBJ = lispdcmd.o plprint.o plsym.o albt.o arm_print.o
69KERNELOBJ= $(COBJ) arm-asmutils.o  imports.o
70
71SPINC = lisp.s m4macros.m4 arm-constants.s arm-macros.s errors.s arm-uuo.s \
72        lisp_globals.s
73
74CHEADERS = area.h bits.h arm-constants.h lisp-errors.h gc.h lisp.h \
75        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
76        threads.h arm-exceptions.h $(PLATFORM_H)
77
78# Subprims linked into the kernel ?
79# Yes:
80
81KSPOBJ = $(SPOBJ)
82all:    ../../aarmcl.so ../../aarmcl
83
84aarmcl.o: aarmcl.c
85        $(CC) -g -I$(NDKINC) -c $< -fpic -o $@
86
87# No:
88
89# KSPOBJ=
90# all:  ../../armcl ../../subprims.so
91
92OSLIBS = -ldl -lm -lc
93APPLIBS = $(OSLIBS) $(NDKLIB)/crtbegin_dynamic.o $(NDKLIB)/crtend_android.o
94
95
96../../aarmcl.so:        $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) ./armandroid.x ./fixlib
97        $(LD) --shared -Bdynamic -dynamic-linker /system/bin/linker -nostdlib -z nocopyreloc  -o ../../aarmcl.so  -L $(NDKLIB) pad.o arm-spentry.o  pmcl-kernel.o gc-common.o arm-gc.o bits.o arm-exceptions.o image.o thread_manager.o lisp-debug.o memory.o unix-calls.o arm-asmutils.o imports.o lispdcmd.o plprint.o plsym.o albt.o arm_print.o $(OSLIBS) -T ./armandroid.x
98        ./fixlib $(LIBBASE) >> ../../aarmcl.so
99
100../../aarmcl:   aarmcl.o
101                $(LD) -Bdynamic -e _start  -dynamic-linker /system/bin/linker -nostdlib -z nocopyreloc  -o ../../aarmcl -L $(NDKLIB) aarmcl.o $(APPLIBS)
102
103./fixlib: ./fixlib.c
104        $(HOSTCC) -g $< -o $@
105
106$(SPOBJ): $(SPINC)
107$(ASMOBJ): $(SPINC)
108$(COBJ): $(CHEADERS)
109$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
110
111
112cclean:
113        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../aarmcl ../../aarmcl.so ./fixlib
114
115clean:  cclean
116        $(RM) -f $(SPOBJ)
117
Note: See TracBrowser for help on using the repository browser.