-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
85 lines (62 loc) · 2.08 KB
/
premake5.lua
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
workspace "Xplat"
configurations { "GB", "NES", "SG", "PDX" }
architecture "x86_64"
inheritdependencies "off"
project "ProjectName"
files { "src/**.c" }
filter "configurations:GB"
kind "Makefile"
defines { "NINTENDO", "__TARGET_gb" }
includedirs { "$(GBDK_HOME)/include" }
debugcommand ( "$(GBDK_EMU)" )
debugargs { "%{prj.location}bin/%{cfg.buildcfg}/%{prj.name}.gb" }
buildcommands {
"$(MAKE_PATH)/make -f %{prj.location}gbdk.mk PLAT=%{cfg.buildcfg} PROJ=%{prj.name}"
}
rebuildcommands {
}
cleancommands {
"$(MAKE_PATH)/make -f %{prj.location}gbdk.mk clean PLAT=%{cfg.buildcfg}"
}
filter "configurations:NES"
kind "Makefile"
defines { "NINTENDO_NES", "__TARGET_nes" }
includedirs { "$(GBDK_HOME)/include" }
debugcommand ( "$(GBDK_EMU)" )
debugargs { "%{prj.location}bin/%{cfg.buildcfg}/%{prj.name}.nes" }
buildcommands {
"$(MAKE_PATH)/make -f %{prj.location}gbdk.mk PLAT=%{cfg.buildcfg} PROJ=%{prj.name}"
}
rebuildcommands {
}
cleancommands {
"$(MAKE_PATH)/make -f %{prj.location}gbdk.mk clean PLAT=%{cfg.buildcfg}"
}
filter "configurations:SG"
kind "Makefile"
defines { "SGDK_GCC" }
includedirs { "$(SGDK_PATH)/inc" }
debugcommand ( "$(SGDK_EMU)" )
debugargs { "%{prj.location}out/rom.bin" }
buildcommands {
"$(MAKE_PATH)/make -f $(SGDK_PATH)/makefile.gen"
}
rebuildcommands {
}
cleancommands {
}
filter "configurations:PDX"
architecture "x86_64"
kind "SharedLib"
cdialect "C11"
defines { "PLAYDATE","TARGET_EXTENSION=1", "_WINDLL=1", "WIN32;_WINDOWS;" }
includedirs { "$(PLAYDATE_SDK_PATH)/C_API" }
removefiles { "src/boot/*.c" }
debugcommand ( "$(PLAYDATE_SDK_PATH)/bin/PlaydateSimulator.exe" )
debugargs { "%{prj.location}bin/PDX/%{prj.name}.pdx" }
postbuildmessage("Copying DLL and Compiling PDX")
postbuildcommands {
"{MKDIR} %{prj.location}bin/PDX/Source",
"{COPYFILE} %{prj.location}bin/PDX/%{prj.name}.dll %{prj.location}bin/PDX/Source/pdex.dll",
"$(PLAYDATE_SDK_PATH)/bin/pdc -sdkpath $(PLAYDATE_SDK_PATH) %{prj.location}bin/PDX/Source %{prj.location}bin/PDX/%{prj.name}.pdx"
}