Merge branch 'feature/handle-quit-event'
[jumpnbump.git] / Makefile
blobf90af4d69b1aeae2dad37dec8adb69ec055a67c7
1 SDL_CFLAGS = `sdl-config --cflags`
2 SDL_LIBS = `sdl-config --libs`
3 CFLAGS = -Wall -O2 -ffast-math -funroll-loops -Dstricmp=strcasecmp \
4 -Dstrnicmp=strncasecmp -DUSE_SDL -DNDEBUG -I. $(SDL_CFLAGS) -DUSE_NET
5 LIBS = $(SDL_LIBS) -lSDL_mixer -lSDL_net
6 SDL_TARGET = sdl.a
7 MODIFY_TARGET = gobpack jnbpack jnbunpack
8 OBJS = fireworks.o main.o menu.o filter.o
9 TARGET = jumpnbump
10 BINARIES = $(TARGET) jumpnbump.svgalib jumpnbump.fbcon $(MODIFY_TARGET) \
11 jnbmenu.tcl
12 PREFIX ?= /usr/local
14 .PHONY: data
16 all: $(BINARIES)
18 $(SDL_TARGET): globals.h
19 cd sdl && make
21 $(MODIFY_TARGET): globals.h
22 cd modify && make
24 $(TARGET): $(OBJS) $(SDL_TARGET) data globals.h
25 $(CC) -o $(TARGET) $(OBJS) $(LIBS) $(SDL_TARGET)
27 $(OBJS): globals.h
29 globals.h: globals.pre
30 sed -e "s#%%PREFIX%%#$(PREFIX)#g" < globals.pre > globals.h
32 jnbmenu.tcl: jnbmenu.pre
33 sed -e "s#%%PREFIX%%#$(PREFIX)#g" < jnbmenu.pre > jnbmenu.tcl
35 data: jnbpack
36 cd data && make
38 clean:
39 cd sdl && make clean
40 cd modify && make clean
41 cd data && make clean
42 rm -f $(TARGET) *.o globals.h jnbmenu.tcl
44 install:
45 mkdir -p $(PREFIX)/games/
46 mkdir -p $(PREFIX)/share/jumpnbump/
47 mkdir -p $(PREFIX)/share/man/man6/
48 install -o root -g games -m 755 $(BINARIES) $(PREFIX)/games/
49 install -o root -g games -m 644 data/jumpbump.dat \
50 $(PREFIX)/share/jumpnbump/jumpbump.dat
51 install -o root -g root -m 644 jumpnbump.6 $(PREFIX)/share/man/man6/
53 uninstall:
54 cd $(PREFIX)/games && rm -f $(BINARIES)
55 rm -rf $(PREFIX)/share/jumpnbump
56 rm -f $(PREFIX)/share/man/man6/jumpnbump.6
58 doc:
59 rman jumpnbump.6 -f HTML >jumpnbump.html