summaryrefslogtreecommitdiff
path: root/mingw.mk (plain)
blob: 3ba32bf03df7e9ca1cfa771bc0e7bb9af69d4287
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

# MSYS doesn't provide pkg-config... *sigh*
# at least prevent "command not found" errors.
LUA_CFLAGS = $() $()
LUA_LDFLAGS = -llua

# search for config.mk in this makefile's directory
include $(dir $(lastword $(MAKEFILE_LIST)))config.mk

# tell generate.lua about /mingw/include and tell gcc about /mingw/bin.
CFLAGS += -I/mingw/include
LDFLAGS += -L/mingw/lib -L/mingw/bin

GL_LDFLAGS := -lopengl32
GLU_LDFLAGS := -lglu32
ZLIB_LDFLAGS := -lzdll
JITLIB ?= $(dir $(or $(wildcard /usr/share/lua/jit/opt.lua),$(wildcard /mingw/share/lua/jit/opt.lua)))
DATADIR :=

# Makefiles without .exe generally work on MSYS, but make clean doesn't work
override target := $(target)$(if $(findstring .exe,$(target)),,.exe)

install uninstall: NO-INSTALLING

$(target):: get-dll
get-dll: remove-dll
	cp /mingw/bin/{SDL,SDL_image,SDL_mixer,*freetype*,zlib*,*jpeg*,*png*,*ogg*,*vorbis*}.dll $(dir $(target))

clean distclean: remove-dll
remove-dll:
	-rm -f $(dir $(target))*.dll

.PHONY: get-dll remove-dll