Makefile 1.62 KB
Newer Older
pcy's avatar
initial  
pcy committed
1
2
3
4
5

default: all

CSC ?= mcs # use csc here if you're on windows
MONO ?= mono # leave this empty on windows
6
MSBUILD ?= xbuild # use msbuild here on windows
pcy's avatar
initial  
pcy committed
7
8
9
10
11
12
13
14
15
16

CSFLAGS := -checked- -unsafe+
CSFLAGS += -lib:lib/ -r:FNA.dll

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

TARGET := bin/fnaglsl.exe

LIBS := lib/FNA.dll lib/FNA.dll.config lib/libmojoshader.so

17
$(TARGET): bin/ $(SOURCES) #$(LIBS)
pcy's avatar
initial  
pcy committed
18
19
20
21
22
23
	$(CSC) $(CSFLAGS) -target:exe -out:"$@" $(SOURCES)

all: $(TARGET)

$(LIBS): lib/
	@>&2 echo "You need to put FNA.dll{,.config} and libmojoshader.so in the" \
24
        "\`lib/' directory."; false
pcy's avatar
initial  
pcy committed
25
26
27
28
29
30
31

debug: CSFLAGS += -debug+
debug: all

release: CSFLAGS += -optimize+
release: all

32
33
34
35
xb:
	$(MSBUILD) PoroCYon.FNAGLSL.csproj
	$(MSBUILD) fnaglsl-test.csproj

pcy's avatar
initial  
pcy committed
36
37
38
39
40
t: debug
	TERM=xterm MONO_PATH="$$PWD/lib/:$$MONO_PATH" \
        LD_LIBRARY_PATH="$$PWD/lib:$$LD_LIBRARY_PATH" \
        FNA_KEYBOARD_USE_SCANCODES=1 FNA_OPENGL_DISABLE_LATESWAPTEAR=1 \
        $(MONO) --debug=mdb-optimizations "$(TARGET)"
pcy's avatar
pcy committed
41
42
43
44
45
46
#        gdb $(MONO) -ex 'r --debug=mdb-optimizations "$(TARGET)"'

#       FNA_OPENGL_FORCE_CORE_PROFILE=1  INTEL_NO_HW=1 \
#       LIBGL_DEBUG=verbose MESA_DEBUG=context MESA_GLSL=useprog,errors,uniform \
#       LIBGL_ALWAYS_SOFTWARE=true \
#       FNA_GRAPHICS_MOJOSHADER_PROFILE=nv4 \
pcy's avatar
lol    
pcy committed
47
#
pcy's avatar
initial  
pcy committed
48

49
50
51
52
53
54
55
tx: xb
	TERM=xterm MONO_PATH="$$PWD/lib/:$$MONO_PATH" \
        LD_LIBRARY_PATH="$$PWD/lib:$$LD_LIBRARY_PATH" \
        FNA_KEYBOARD_USE_SCANCODES=1 FNA_OPENGL_DISABLE_LATESWAPTEAR=1 \
        FNA_OPENGL_FORCE_CORE_PROFILE=1 \
        $(MONO) --debug=mdb-optimizations "bin/Debug/fnaglsl.exe"

pcy's avatar
initial  
pcy committed
56
clean:
57
	@$(RM) -rv bin/* obj/*
pcy's avatar
initial  
pcy committed
58
59
60
61

%/:
	@mkdir -vp "$@"

62
.PHONY: default all debug release t clean tx xb
pcy's avatar
initial  
pcy committed
63