/
Makefile.ios
66 lines (53 loc) · 2.09 KB
/
Makefile.ios
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
OBJECTS= dictionary.o system.o fileaccess.o float.o double.o prefix.o search.o softcore.o stack.o tools.o vm.o primitives.o bit.o lzuncompress.o unix.o utility.o hash.o callback.o word.o extras.o
HEADERS= ficl.h ficlplatform/unix.h
#
# Flags for shared library
#TARGET= -Dlinux # riscos MOTO_CPU32
SHFLAGS = -fPIC
CFLAGS= -O3 $(SHFLAGS) -Wall -arch $(ARC)
CPPFLAGS= $(TARGET) -I. -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk
CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
LIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar cr
RANLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
DST_DIR=local_iPhoneOS_$(ARC)/lib
MAJOR = 4
MINOR = 1.0
# ficl: main.o $(HEADERS) libficl.a
# $(CC) $(CFLAGS) $(LDFLAGS) main.o -o ficl -L. -lficl -lm
# lib: libficl.so.$(MAJOR).$(MINOR)
# static library build
libficl.a: $(OBJECTS)
$(LIB) libficl.a $(OBJECTS)
$(RANLIB) libficl.a
mkdir -p $(DST_DIR)
mv libficl.a $(DST_DIR)
# # shared library build
# libficl.so.$(MAJOR).$(MINOR): $(OBJECTS)
# $(CC) $(LDFLAGS) -shared -Wl,-soname,libficl.so.$(MAJOR).$(MINOR) \
# -o libficl.so.$(MAJOR).$(MINOR) $(OBJECTS)
# ln -sf libficl.so.$(MAJOR).$(MINOR) libficl.so
# main: main.o ficl.h sysdep.h libficl.so.$(MAJOR).$(MINOR)
# $(CC) $(CFLAGS) $(LDFLAGS) main.o -o main -L. -lficl -lm
# ln -sf libficl.so.$(MAJOR).$(MINOR) libficl.so.$(MAJOR)
# depend explicitly to help finding source files in another subdirectory,
# and repeat commands since gmake doesn't understand otherwise
ansi.o: ficlplatform/ansi.c $(HEADERS)
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
unix.o: ficlplatform/unix.c $(HEADERS)
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
#
# generic object code
#
.SUFFIXES: .cxx .cc .c .o
.c.o:
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
.cxx.o:
$(CPP) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
.cc.o:
$(CPP) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
#
# generic cleanup code
#
clean:
rm -f *.o *.a libficl.* ficl
rm -rf $(DST_DIR)