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

Last change on this file since 15012 was 15012, checked in by gb, 9 years ago

linux-files.lisp: try to use #_dladdr in Android version of
%probe-shared-library. Don't know if that works, but #$RTLD_NOLOAD
isn't defined and (probably) isn't supported on Android.

lisp-kernel/androidarm/Makefile: use current (r6b) Android NDK;
use Android-9 API (2.3).

lisp-kernel/pmcl-kernel: when reading /proc/cpuinfo to determine
ARM arch, use fgets() because Android doesn't offer getline().

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-r6b
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
73CHEADERS = area.h bits.h arm-constants.h lisp-errors.h gc.h lisp.h \
74        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
75        threads.h arm-exceptions.h $(PLATFORM_H)
76
77# Subprims linked into the kernel ?
78# Yes:
79
80KSPOBJ = $(SPOBJ)
81all:    ../../aarmcl.so ../../aarmcl
82
83aarmcl.o: aarmcl.c
84        $(CC) -g -I$(NDKINC) -c $< -fpic -o $@
85
86# No:
87
88# KSPOBJ=
89# all:  ../../armcl ../../subprims.so
90
91OSLIBS = -ldl -lm -lc
92APPLIBS = $(OSLIBS) $(NDKLIB)/crtbegin_dynamic.o $(NDKLIB)/crtend_android.o
93
94
95../../aarmcl.so:        $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) ./armandroid.x ./fixlib
96        $(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
97        ./fixlib $(LIBBASE) >> ../../aarmcl.so
98
99../../aarmcl:   aarmcl.o
100                $(LD) -Bdynamic -e _start  -dynamic-linker /system/bin/linker -nostdlib -z nocopyreloc  -o ../../aarmcl -L $(NDKLIB) aarmcl.o $(APPLIBS)
101
102./fixlib: ./fixlib.c
103        $(HOSTCC) -g $< -o $@
104
105$(SPOBJ): $(SPINC)
106$(ASMOBJ): $(SPINC)
107$(COBJ): $(CHEADERS)
108$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
109
110
111cclean:
112        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../aarmcl ../../aarmcl.so ./fixlib
113
114clean:  cclean
115        $(RM) -f $(SPOBJ)
116
Note: See TracBrowser for help on using the repository browser.