Dragging in some modules when X86Compiler is used, so scripts can use them.
[trylon.git] / makefile
blob95708e0560e1c13d66b50a7cef1f1adcb8c9a116
1 ifndef PREFIX
2 PREFIX := /usr
3 endif
5 ifeq "$(shell uname)" "Darwin"
6 PLATFORM_FLAGS = -DMAC_OSX
7 # Try "homebrew" first when finding the Boehm GC...
8 PLATFORM_FLAGS += -I /usr/local/include -L/usr/local/lib
9 # Otherwise try Fink...
10 PLATFORM_FLAGS += -I/opt/local/include -L/opt/local/lib
11 # Use this if you're using Fink:
12 # PLATFORM_FLAGS += -DOSX_FINK -I/sw/include -L/sw/lib
13 endif
15 all: trylon
17 trylon:
18 $(CC) -o trylon .c-sources/*.c -lgc -lm $(PLATFORM_FLAGS)
20 .PHONY: install clean tests syntax-test fix-bugs-test x86-compiler-test
22 install:
23 install -d $(PREFIX)/bin
24 install -d $(PREFIX)/lib
25 install trylon $(PREFIX)/bin
26 install trylon-interpreter $(PREFIX)/bin
27 cp -r library $(PREFIX)/lib/trylon
29 clean:
30 rm -rf \
31 .c-sources .objects .c-sources-2 .objects-2
33 tests: syntax-test standard-library-test fixed-bugs-test x86-compiler-test
35 syntax-test:
36 cd tests/syntax && rm -f syntax-test && make && trylon main && echo
38 standard-library-test:
39 cd tests/standard-library && rm -f test-standard-library .objects/* && make && echo
41 fixed-bugs-test:
42 cd tests/fixed-bugs && rm -f test-fixed-bugs .objects/* && make && echo
44 x86-compiler-test:
45 cd sources/X86Compiler/test && make
48 # Tarball creation.
50 TARBALL_FILES := sources makefile ReadMe License tarball-date version
51 TARBALL_FILES += library/Trylon_.h library/Trylon_.c library/build-settings
52 TARBALL_FILES += library/Standard library/Posix
53 TARBALL_FILES += library/Cairo library/Xlib library/Xft library/Readline
54 TARBALL_FILES += docs/source docs/html docs/makefile
55 TARBALL_FILES += docs/doctifier/build-settings docs/doctifier/sources
56 TARBALL_FILES += tests
57 TARBALL_FILES += build-settings .c-sources
58 TARBALL_FILES += trylon-interpreter
60 TRYLON_DIR := $(notdir $(PWD))
61 TARBALL_FILES := $(addprefix $(TRYLON_DIR)/,$(TARBALL_FILES))
63 tarball:
64 date "+%Y.%m.%d %k:%M %z" > tarball-date
65 cd .. && tar --create --gzip --file=$(TRYLON_DIR)/trylon.tgz \
66 $(TARBALL_FILES)