This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
65 lines (55 loc) · 1.68 KB
/
makefile
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
65
# NecroLua makefile for nmake.
# Copyright (C) 2019 Manuel Blanc. See Copyright Notice in LICENSE.txt
# Configuration
EXENAME=NecroLua
DLLNAME=NecroLuaAPI
VERSION=0.3.0
ZIPNAME=$(EXENAME)-$(VERSION)
# ==============================================================================
# Internal settings. You should not need to edit anything beyond this point.
!IFNDEF RELEASE
RELEASE=0
!ENDIF
ZIPFILES=$(EXENAME).exe $(DLLNAME).dll README.md LICENSE.txt LEGAL.txt steam_appid.txt
DEFINES=/DEXENAME=\"$(EXENAME)\" /DDLLNAME=\"$(DLLNAME)\" /DRELEASE=$(RELEASE) /DVERSION=$(VERSION)
CFLAGS=/nologo /W3 /I include $(DEFINES)
LDFLAGS=/link /nologo /LIBPATH:lib
RFLAGS=/nologo $(DEFINES) /DVERSION=\"$(VERSION)\" /DUSERNAME=\"$(USERNAME)\" /DCOMPUTERNAME=\"$(COMPUTERNAME)\"
ZIP=zip -9lovu
# Phony.
all: $(EXENAME).exe $(DLLNAME).dll
release:
cmd /C "set RELEASE=1 && $(MAKE) /nologo /$(MAKEFLAGS) $(ZIPNAME).zip"
test: all
$(EXENAME) 0
clean:
-del $(DLLNAME).dll
-del $(DLLNAME).lib
-del $(EXENAME).exe
-del nl_launcher.ico
-del nl_launcher.res
-del *.exp
-del *.obj
-del $(ZIPNAME).zip
# Release zipfile.
$(ZIPNAME).zip: $(ZIPFILES)
$(ZIP) $(ZIPNAME).zip $**
# Launcher.
$(EXENAME).exe: nl_launcher.obj nl_launcher.res
$(CC) /Fe:$(EXENAME).exe $** $(LDFLAGS)
# Payload.
$(DLLNAME).dll: nl_payload.obj nl_luainit.obj
$(CC) /Fe:$(DLLNAME).dll $** /LD $(LDFLAGS)
# Recipes.
.SUFFIXES: .png .lua
.png.ico:
magick convert $< -define icon:auto-resize="256,128,64,48,32,16" $@
.lua.obj:
luajit -bgn $(DLLNAME).init $< $@
# Dependencies.
nl_launcher.obj nl_payload.obj: nl_common.h
nl_launcher.res: nl_launcher.rc
!IF $(RELEASE)
!MESSAGE Building RELEASE version $(VERSION)
nl_launcher.res: nl_launcher.ico
!ENDIF