-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
67 lines (51 loc) · 1.5 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
66
67
#!/usr/bin/make -f
#---------------------------------------
# CONSTANTS
#---------------------------------------
# Game config
BINDIR = bin
COMPILER = mcs
FLAGS = -debug+ -define:DEBUG -define:TRACE -target:winexe
LIBPATHS = $(MONOGAME_PATH)
LIBS = MonoGame.Framework.dll System.Runtime.Serialization.dll System.Windows.Forms.dll
OBJDIR = obj
SRCDIR = src
TARGET = ik_demo.exe
TMPDIR = tmp
#---------------------------------------
# INITIALIZATION
#---------------------------------------
# Linux and macOS have different paths to the MonoGame library files, so make
# sure to set them up properly. No Windows support here, lol!
OS := $(shell uname)
ifeq "$(OS)" "Linux"
MONOGAME_PATH = /usr/lib/mono/xbuild/MonoGame/v3.0
endif
ifeq "$(OS)" "Darwin"
MONOGAME_PATH = /Library/Frameworks/MonoGame.framework/Current
endif
MONOGAME_PATH := $(MONOGAME_PATH)/Assemblies/DesktopGL
#---------------------------------------
# TARGETS
#---------------------------------------
.PHONY: all clean libs run
.PHONY: $(BINDIR)/$(TARGET) compile
all: compile libs
$(BINDIR)/$(TARGET):
mkdir -p $(BINDIR)
$(COMPILER) $(FLAGS) \
$(addprefix -lib:, $(LIBPATHS)) \
$(addprefix -r:, $(LIBS)) \
-out:$(BINDIR)/$(TARGET) \
-recurse:$(SRCDIR)/*.cs
clean:
rm -fr $(BINDIR) $(CONTENTFILE) doc
compile: $(BINDIR)/$(TARGET)
doc:
doxygen
libs:
mkdir -p $(BINDIR)
-cp -nr $(MONOGAME_PATH)/* $(BINDIR)
run:
cd $(BINDIR); \
mono $(TARGET)