Makefile 1.16 KB
Newer Older
pcy's avatar
pcy committed
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

TERRPATH ?= $$HOME/games/tModLoader/tModLoader
#TMLEXE   ?= $(TERRPATH)/tModLoader.exe
TMLBUILDSERV ?= mono $(TERRPATH)/tModLoaderServer.exe

MCS ?= mcs

TMLLOCDIR ?= $$HOME/.local/share/Terraria/ModLoader

REFDIRS := $(TERRPATH)/ModCompile/ $(TERRPATH)/ $(TMLLOCDIR)/references

GENERICREFS := \
    tModLoader.exe Steamworks.NET.dll ReLogic.dll Ionic.Zip.Reduced.dll \
    Mono.Cecil.dll Mono.Cecil.Mdb.dll Mono.Cecil.Pdb.dll \
    MonoMod.RuntimeDetour.dll MonoMod.Utils.dll TerrariaHooks.dll

#XNAREF_Windows := Microsoft.Xna.Framework.dll \
    Microsoft.Xna.Framework.Graphics.dll Microsoft.Xna.Framework.Game.dll
XNAREF_XNA := FNA.dll # fuck it
XNAREF_FNA := FNA.dll

MCSFLAGS := -checked- -debug -target:library -unsafe+ \
    $(patsubst %,-lib:"%",$(REFDIRS)) \
    $(patsubst %,-r:"%",$(GENERICREFS))

SOURCES := $(wildcard *.cs */*.cs)

glsltest.%.dll: $(SOURCES)
	$(MCS) -out:"glsltest.dll" $(MCSFLAGS) $(patsubst %,-r:"%",$(XNAREF_$*)) $^
	mv glsltest.dll "$@"
	mv glsltest.dll.mdb "glsltest.$*".pdb

all: glsltest.FNA.dll glsltest.XNA.dll
	$(TMLBUILDSERV) -build "$(PWD)" -eac glsltest.FNA.dll \
        -define 'DEBUG;TRACE' -unsafe 1

clean:
	@-$(RM) -v *.dll *.pdb