Details | Last modification | View Log
Rev | Author | Line No. | Line |
---|---|---|---|
125 | lvd | 1 | # Makefile for sjasmplus created by Tygrys' hands. |
2 | # install/uninstall features added, CFLAGS and LDFLAGS modification by z00m's hands. [05.05.2016] |
||
3 | # overall optimization and beautification by mborik's hands. [05.05.2016] |
||
4 | # Mac OS X adaptation by z00m's hands. [16.05.2018] |
||
5 | # For build on Mac OS X run `make -f Makefile.osx` |
||
6 | |||
7 | GCC=gcc |
||
8 | CC=$(GCC) |
||
9 | GPP=g++ |
||
10 | C++=$(GPP) |
||
11 | |||
12 | PREFIX=/opt/local |
||
13 | INSTALL=install -c |
||
14 | UNINSTALL=rm -vf |
||
15 | DOCBOOKGEN=xsltproc |
||
16 | |||
17 | EXE=sjasmplus |
||
18 | |||
19 | SUBDIR_BASE=sjasm |
||
20 | SUBDIR_LUA=lua5.1 |
||
21 | SUBDIR_TOLUA=tolua++ |
||
22 | |||
23 | CFLAGS=-DNDEBUG -O2 -Wall -pedantic -DUSE_LUA -DLUA_USE_MACOSX -DMAX_PATH=PATH_MAX -I$(SUBDIR_LUA) -I$(SUBDIR_TOLUA) |
||
24 | CXXFLAGS=-std=gnu++14 $(CFLAGS) |
||
25 | |||
26 | # for Mac (removed strip flag) |
||
27 | LDFLAGS=-ldl |
||
28 | |||
29 | #sjasmplus object files |
||
30 | OBJS=\ |
||
31 | $(SUBDIR_BASE)/devices.o \ |
||
32 | $(SUBDIR_BASE)/directives.o \ |
||
33 | $(SUBDIR_BASE)/io_nex.o \ |
||
34 | $(SUBDIR_BASE)/io_snapshots.o \ |
||
35 | $(SUBDIR_BASE)/io_trd.o \ |
||
36 | $(SUBDIR_BASE)/io_tape.o \ |
||
37 | $(SUBDIR_BASE)/lua_lpack.o \ |
||
38 | $(SUBDIR_BASE)/lua_sjasm.o \ |
||
39 | $(SUBDIR_BASE)/parser.o \ |
||
40 | $(SUBDIR_BASE)/reader.o \ |
||
41 | $(SUBDIR_BASE)/sjasm.o \ |
||
42 | $(SUBDIR_BASE)/sjio.o \ |
||
43 | $(SUBDIR_BASE)/support.o \ |
||
44 | $(SUBDIR_BASE)/tables.o \ |
||
45 | $(SUBDIR_BASE)/z80.o |
||
46 | |||
47 | #liblua objects |
||
48 | LUAOBJS= \ |
||
49 | $(SUBDIR_LUA)/lapi.o $(SUBDIR_LUA)/lauxlib.o $(SUBDIR_LUA)/lbaselib.o \ |
||
50 | $(SUBDIR_LUA)/lcode.o $(SUBDIR_LUA)/ldblib.o $(SUBDIR_LUA)/ldebug.o \ |
||
51 | $(SUBDIR_LUA)/ldo.o $(SUBDIR_LUA)/ldump.o $(SUBDIR_LUA)/lfunc.o \ |
||
52 | $(SUBDIR_LUA)/lgc.o $(SUBDIR_LUA)/linit.o $(SUBDIR_LUA)/liolib.o \ |
||
53 | $(SUBDIR_LUA)/llex.o $(SUBDIR_LUA)/lmathlib.o $(SUBDIR_LUA)/lmem.o \ |
||
54 | $(SUBDIR_LUA)/loadlib.o $(SUBDIR_LUA)/lobject.o $(SUBDIR_LUA)/lopcodes.o \ |
||
55 | $(SUBDIR_LUA)/loslib.o $(SUBDIR_LUA)/lparser.o $(SUBDIR_LUA)/lstate.o \ |
||
56 | $(SUBDIR_LUA)/lstring.o $(SUBDIR_LUA)/lstrlib.o $(SUBDIR_LUA)/ltable.o \ |
||
57 | $(SUBDIR_LUA)/ltablib.o $(SUBDIR_LUA)/ltm.o $(SUBDIR_LUA)/lundump.o \ |
||
58 | $(SUBDIR_LUA)/lvm.o $(SUBDIR_LUA)/lzio.o |
||
59 | |||
60 | # tolua objects |
||
61 | TOLUAOBJS=\ |
||
62 | $(SUBDIR_TOLUA)/tolua_event.o \ |
||
63 | $(SUBDIR_TOLUA)/tolua_is.o \ |
||
64 | $(SUBDIR_TOLUA)/tolua_map.o \ |
||
65 | $(SUBDIR_TOLUA)/tolua_push.o \ |
||
66 | $(SUBDIR_TOLUA)/tolua_to.o |
||
67 | |||
68 | |||
69 | .PHONY: all clean docs |
||
70 | |||
71 | all: $(LUAOBJS) $(TOLUAOBJS) $(OBJS) |
||
72 | $(GPP) -o $(EXE) $(CXXFLAGS) $(OBJS) $(LUAOBJS) $(TOLUAOBJS) $(LDFLAGS) |
||
73 | |||
74 | install: |
||
75 | $(INSTALL) $(EXE) $(PREFIX)/bin |
||
76 | |||
77 | uninstall: |
||
78 | $(UNINSTALL) $(PREFIX)/bin/$(EXE) |
||
79 | |||
80 | .c.o: |
||
81 | $(GCC) $(CFLAGS) -o $@ -c $< |
||
82 | |||
83 | .cpp.o: |
||
84 | $(GPP) $(CXXFLAGS) -o $@ -c $< |
||
85 | |||
86 | docs: |
||
87 | $(DOCBOOKGEN) \ |
||
88 | --stringparam generate.toc "book toc" \ |
||
89 | -o docs/documentation.html \ |
||
90 | docs/docbook-xsl-ns-html-customization-osx.xsl \ |
||
91 | docs/documentation.xml |
||
92 | |||
93 | clean: |
||
94 | $(UNINSTALL) \ |
||
95 | $(SUBDIR_BASE)/*.o \ |
||
96 | $(SUBDIR_LUA)/*.o \ |
||
97 | $(SUBDIR_TOLUA)/*.o \ |
||
98 | $(EXE) *~ |