Update Unicode docs
[factor/jcg.git] / Makefile
blob519baa28d1e7147e84a7c1b94530e93cf26d2835
1 CC = gcc
2 AR = ar
3 LD = ld
5 EXECUTABLE = factor
6 VERSION = 0.92
8 IMAGE = factor.image
9 BUNDLE = Factor.app
10 LIBPATH = -L/usr/X11R6/lib
11 CFLAGS = -Wall
13 ifdef DEBUG
14 CFLAGS += -g
15 else
16 CFLAGS += -O3 $(SITE_CFLAGS)
17 endif
19 ifdef CONFIG
20 include $(CONFIG)
21 endif
23 ENGINE = $(DLL_PREFIX)factor$(DLL_SUFFIX)$(DLL_EXTENSION)
25 DLL_OBJS = $(PLAF_DLL_OBJS) \
26 vm/alien.o \
27 vm/bignum.o \
28 vm/callstack.o \
29 vm/code_block.o \
30 vm/code_gc.o \
31 vm/code_heap.o \
32 vm/data_gc.o \
33 vm/data_heap.o \
34 vm/debug.o \
35 vm/errors.o \
36 vm/factor.o \
37 vm/ffi_test.o \
38 vm/image.o \
39 vm/io.o \
40 vm/math.o \
41 vm/primitives.o \
42 vm/profiler.o \
43 vm/quotations.o \
44 vm/run.o \
45 vm/types.o \
46 vm/utilities.o
48 EXE_OBJS = $(PLAF_EXE_OBJS)
50 default:
51 $(MAKE) `./build-support/factor.sh make-target`
53 help:
54 @echo "Run '$(MAKE)' with one of the following parameters:"
55 @echo ""
56 @echo "freebsd-x86-32"
57 @echo "freebsd-x86-64"
58 @echo "linux-x86-32"
59 @echo "linux-x86-64"
60 @echo "linux-ppc"
61 @echo "linux-arm"
62 @echo "openbsd-x86-32"
63 @echo "openbsd-x86-64"
64 @echo "netbsd-x86-32"
65 @echo "netbsd-x86-64"
66 @echo "macosx-x86-32"
67 @echo "macosx-x86-64"
68 @echo "macosx-ppc"
69 @echo "solaris-x86-32"
70 @echo "solaris-x86-64"
71 @echo "wince-arm"
72 @echo "winnt-x86-32"
73 @echo "winnt-x86-64"
74 @echo ""
75 @echo "Additional modifiers:"
76 @echo ""
77 @echo "DEBUG=1 compile VM with debugging information"
78 @echo "SITE_CFLAGS=... additional optimization flags"
79 @echo "NO_UI=1 don't link with X11 libraries (ignored on Mac OS X)"
80 @echo "X11=1 force link with X11 libraries instead of Cocoa (only on Mac OS X)"
82 openbsd-x86-32:
83 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.openbsd.x86.32
85 openbsd-x86-64:
86 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.openbsd.x86.64
88 freebsd-x86-32:
89 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.freebsd.x86.32
91 freebsd-x86-64:
92 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.freebsd.x86.64
94 netbsd-x86-32:
95 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.netbsd.x86.32
97 netbsd-x86-64:
98 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.netbsd.x86.64
100 macosx-freetype:
101 ln -sf libfreetype.6.dylib \
102 Factor.app/Contents/Frameworks/libfreetype.dylib
104 macosx-ppc: macosx-freetype
105 $(MAKE) $(EXECUTABLE) macosx.app CONFIG=vm/Config.macosx.ppc
107 macosx-x86-32: macosx-freetype
108 $(MAKE) $(EXECUTABLE) macosx.app CONFIG=vm/Config.macosx.x86.32
110 macosx-x86-64: macosx-freetype
111 $(MAKE) $(EXECUTABLE) macosx.app CONFIG=vm/Config.macosx.x86.64
113 linux-x86-32:
114 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.x86.32
116 linux-x86-64:
117 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.x86.64
119 linux-ppc:
120 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.ppc
122 linux-arm:
123 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.arm
125 solaris-x86-32:
126 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.solaris.x86.32
128 solaris-x86-64:
129 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.solaris.x86.64
131 freetype6.dll:
132 wget http://factorcode.org/dlls/freetype6.dll
133 chmod 755 freetype6.dll
135 zlib1.dll:
136 wget http://factorcode.org/dlls/zlib1.dll
137 chmod 755 zlib1.dll
139 winnt-x86-32: freetype6.dll zlib1.dll
140 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.32
142 winnt-x86-64:
143 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.64
145 wince-arm:
146 $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.ce.arm
148 macosx.app: factor
149 mkdir -p $(BUNDLE)/Contents/MacOS
150 mv $(EXECUTABLE) $(BUNDLE)/Contents/MacOS/factor
151 ln -s Factor.app/Contents/MacOS/factor ./factor
152 cp $(ENGINE) $(BUNDLE)/Contents/Frameworks
154 install_name_tool \
155 -change libfactor.dylib \
156 @executable_path/../Frameworks/libfactor.dylib \
157 Factor.app/Contents/MacOS/factor
159 factor: $(DLL_OBJS) $(EXE_OBJS)
160 $(LINKER) $(ENGINE) $(DLL_OBJS)
161 $(CC) $(LIBS) $(LIBPATH) -L. $(LINK_WITH_ENGINE) \
162 $(CFLAGS) -o $@$(EXE_SUFFIX)$(EXE_EXTENSION) $(EXE_OBJS)
164 clean:
165 rm -f vm/*.o
166 rm -f factor*.dll libfactor.{a,so,dylib}
168 vm/resources.o:
169 $(WINDRES) vm/factor.rs vm/resources.o
171 .c.o:
172 $(CC) -c $(CFLAGS) -o $@ $<
174 .S.o:
175 $(CC) -x assembler-with-cpp -c $(CFLAGS) -o $@ $<
177 .m.o:
178 $(CC) -c $(CFLAGS) -o $@ $<
180 .PHONY: factor