Details | Last modification | View Log
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 125 | lvd | 1 | # Makefile for MinGW by mborik & z00m |
| 2 | # Change `PREFIX` according your needs |
||
| 3 | # Run it with `make -f Makefile.win` |
||
| 4 | |||
| 5 | GCC=gcc.exe |
||
| 6 | CC=$(GCC) |
||
| 7 | GPP=g++.exe |
||
| 8 | C++=$(GPP) |
||
| 9 | |||
| 10 | PREFIX=c:/mingw/usr/local/bin/ |
||
| 11 | CREATEDIR=mkdir -p |
||
| 12 | INSTALL=cp |
||
| 13 | UNINSTALL=rm -f |
||
| 14 | WINDRES=windres.exe --preprocessor "cpp.exe" |
||
| 15 | COMPRESS=upx.exe --best -vk --overlay=skip --compress-icons=0 |
||
| 16 | |||
| 17 | EXE=sjasmplus.exe |
||
| 18 | |||
| 19 | SUBDIR_BASE=sjasm |
||
| 20 | SUBDIR_LUA=lua5.1 |
||
| 21 | SUBDIR_TOLUA=tolua++ |
||
| 22 | |||
| 23 | CFLAGS=-DNDEBUG -O2 -Wall -pedantic -static -DUSE_LUA -DLUA_USE_WINDOWS -DMAX_PATH=PATH_MAX -I$(SUBDIR_LUA) -I$(SUBDIR_TOLUA) |
||
| 24 | CXXFLAGS=-std=gnu++14 $(CFLAGS) |
||
| 25 | |||
| 26 | LDFLAGS= -s |
||
| 27 | |||
| 28 | #sjasmplus object files |
||
| 29 | OBJS=\ |
||
| 30 | $(SUBDIR_BASE)/devices.o \ |
||
| 31 | $(SUBDIR_BASE)/directives.o \ |
||
| 32 | $(SUBDIR_BASE)/io_nex.o \ |
||
| 33 | $(SUBDIR_BASE)/io_snapshots.o \ |
||
| 34 | $(SUBDIR_BASE)/io_trd.o \ |
||
| 35 | $(SUBDIR_BASE)/io_tape.o \ |
||
| 36 | $(SUBDIR_BASE)/lua_lpack.o \ |
||
| 37 | $(SUBDIR_BASE)/lua_sjasm.o \ |
||
| 38 | $(SUBDIR_BASE)/parser.o \ |
||
| 39 | $(SUBDIR_BASE)/reader.o \ |
||
| 40 | $(SUBDIR_BASE)/sjasm.o \ |
||
| 41 | $(SUBDIR_BASE)/sjio.o \ |
||
| 42 | $(SUBDIR_BASE)/support.o \ |
||
| 43 | $(SUBDIR_BASE)/tables.o \ |
||
| 44 | $(SUBDIR_BASE)/z80.o |
||
| 45 | |||
| 46 | #liblua objects |
||
| 47 | LUAOBJS= \ |
||
| 48 | $(SUBDIR_LUA)/lapi.o $(SUBDIR_LUA)/lauxlib.o $(SUBDIR_LUA)/lbaselib.o \ |
||
| 49 | $(SUBDIR_LUA)/lcode.o $(SUBDIR_LUA)/ldblib.o $(SUBDIR_LUA)/ldebug.o \ |
||
| 50 | $(SUBDIR_LUA)/ldo.o $(SUBDIR_LUA)/ldump.o $(SUBDIR_LUA)/lfunc.o \ |
||
| 51 | $(SUBDIR_LUA)/lgc.o $(SUBDIR_LUA)/linit.o $(SUBDIR_LUA)/liolib.o \ |
||
| 52 | $(SUBDIR_LUA)/llex.o $(SUBDIR_LUA)/lmathlib.o $(SUBDIR_LUA)/lmem.o \ |
||
| 53 | $(SUBDIR_LUA)/loadlib.o $(SUBDIR_LUA)/lobject.o $(SUBDIR_LUA)/lopcodes.o \ |
||
| 54 | $(SUBDIR_LUA)/loslib.o $(SUBDIR_LUA)/lparser.o $(SUBDIR_LUA)/lstate.o \ |
||
| 55 | $(SUBDIR_LUA)/lstring.o $(SUBDIR_LUA)/lstrlib.o $(SUBDIR_LUA)/ltable.o \ |
||
| 56 | $(SUBDIR_LUA)/ltablib.o $(SUBDIR_LUA)/ltm.o $(SUBDIR_LUA)/lundump.o \ |
||
| 57 | $(SUBDIR_LUA)/lvm.o $(SUBDIR_LUA)/lzio.o |
||
| 58 | |||
| 59 | # tolua objects |
||
| 60 | TOLUAOBJS=\ |
||
| 61 | $(SUBDIR_TOLUA)/tolua_event.o \ |
||
| 62 | $(SUBDIR_TOLUA)/tolua_is.o \ |
||
| 63 | $(SUBDIR_TOLUA)/tolua_map.o \ |
||
| 64 | $(SUBDIR_TOLUA)/tolua_push.o \ |
||
| 65 | $(SUBDIR_TOLUA)/tolua_to.o |
||
| 66 | |||
| 67 | RES=sjasmwin32/sjasmplus.res |
||
| 68 | |||
| 69 | |||
| 70 | .PHONY: all clean |
||
| 71 | |||
| 72 | all: $(LUAOBJS) $(TOLUAOBJS) $(OBJS) $(RES) |
||
| 73 | $(GPP) -o $(EXE) $(CXXFLAGS) $(OBJS) $(LUAOBJS) $(TOLUAOBJS) $(LDFLAGS) $(RES) |
||
| 74 | |||
| 75 | install: |
||
| 76 | $(CREATEDIR) $(PREFIX) |
||
| 77 | $(INSTALL) $(EXE) $(PREFIX) |
||
| 78 | |||
| 79 | uninstall: |
||
| 80 | $(UNINSTALL) $(PREFIX)/$(EXE) |
||
| 81 | |||
| 82 | compress: |
||
| 83 | $(COMPRESS) $(EXE) |
||
| 84 | |||
| 85 | .c.o: |
||
| 86 | $(GCC) $(CFLAGS) -o $@ -c $< |
||
| 87 | |||
| 88 | .cpp.o: |
||
| 89 | $(GPP) $(CXXFLAGS) -o $@ -c $< |
||
| 90 | |||
| 91 | $(RES): sjasmwin32/sjasmplus.mingw.rc |
||
| 92 | $(WINDRES) -i $< -O coff -o $@ |
||
| 93 | |||
| 94 | clean: |
||
| 95 | $(UNINSTALL) \ |
||
| 96 | $(SUBDIR_BASE)/*.o \ |
||
| 97 | $(SUBDIR_LUA)/*.o \ |
||
| 98 | $(SUBDIR_TOLUA)/*.o \ |
||
| 99 | $(RES) $(EXE) *~ |