Mostly additions to the NSIS script: split the hidden section into a
[neverball] / Makefile.mingw
1 #-----------------------------------------------------------------------------
2
3 EXT= .exe
4 include Makefile
5
6 #-----------------------------------------------------------------------------
7
8 WINE= wine
9
10 OGL_LIBS= -lm -lopengl32
11 BASE_LIBS= -lSDL -lSDL_image -lintl
12
13 LIBS= \
14         $(SDL_LIBS) -lSDL_image -lSDL_mixer -lSDL_ttf \
15         $(OGL_LIBS) $(PNG_LIBS) -lintl
16
17 #-----------------------------------------------------------------------------
18
19 MAKENSIS= makensis
20 TODOS= todos
21 FROMDOS= fromdos
22 CP= cp
23
24 TEXT_DOCS= \
25         doc/AUTHORS \
26         doc/MANUAL  \
27         CHANGES     \
28         COPYING     \
29         README
30
31 TXT_DOCS= $(TEXT_DOCS:%=%.txt)
32
33 #-----------------------------------------------------------------------------
34
35 .PHONY: setup
36 setup: install-dlls convert-text-files all
37         $(MAKENSIS) -DVERSION=$(VERSION) -nocd scripts/neverball.nsi
38
39 # Fails on MSYS due to a bug in the shipped version of make.
40 # setup: LDFLAGS += -s
41
42 setup: LDFLAGS := $(LDFLAGS) -s
43
44 .PHONY: clean-setup
45 clean-setup: clean
46         $(RM) install-dlls.sh *.dll $(TXT_DOCS)
47         find data -name "*.txt" -exec $(FROMDOS) {} \;
48
49 #-----------------------------------------------------------------------------
50
51 .PHONY: install-dlls
52 install-dlls: install-dlls.sh
53         sh $<
54
55 install-dlls.sh:
56         if ! sh scripts/gen-install-dlls.sh > $@; then \
57             $(RM) $@; \
58             exit 1; \
59         fi
60         @echo --------------------------------------------------------
61         @echo You can probably ignore any file-not-found errors above.
62         @echo Now edit $@ to your needs before restarting make.
63         @echo --------------------------------------------------------
64         @exit 1
65
66 #-----------------------------------------------------------------------------
67
68 .PHONY: convert-text-files
69 convert-text-files: $(TXT_DOCS)
70         find data -name "*.txt" -exec $(TODOS) {} \;
71
72 %.txt: %
73         $(CP) $< $@
74         $(TODOS) $@
75
76 #-----------------------------------------------------------------------------
77