Started with gobpack.
[crow/jumpnbump.git] / Makefile
1 OBJS = sdl/gfx.o sdl/interrpt.o sdl/sound.o sdl/input.o fireworks.o main.o menu.o
2 TARGET = jumpnbump
3
4 CC = gcc
5 CFLAGS = -Wall -O2 -ffast-math -funroll-loops -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DUSE_SDL -DNDEBUG -I. $(shell sdl-config --cflags)
6 LIBS = -lm $(shell sdl-config --libs) -lSDL_mixer
7
8 .PHONY: data
9
10 all: $(TARGET) jnbpack jnbunpack data
11
12 $(TARGET): $(OBJS)
13         $(CC) $(LFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
14
15 jnbpack: modify/jnbpack.o
16         $(CC) $(LFLAGS) -o jnbpack modify/jnbpack.o $(LIBS)
17
18 jnbunpack: modify/jnbunpack.o
19         $(CC) $(LFLAGS) -o jnbunpack modify/jnbunpack.o $(LIBS)
20
21 data: jnbpack
22         $(MAKE) -C data
23
24 clean:
25         rm -f $(TARGET) jnbpack jnbunpack *.o sdl/*.o *~ log modify/*.o
26         $(MAKE) -C data clean
27
28 install:
29         mkdir -p $(DESTDIR)/usr/games/
30         mkdir -p $(DESTDIR)/usr/share/jumpnbump/
31         install -o root -g games -m 755 $(TARGET) jumpnbump.svgalib jnbpack jnbunpack jnbmenu.tcl $(DESTDIR)/usr/games/
32         install -o root -g games -m 644 data/jumpbump.dat $(DESTDIR)/usr/share/jumpnbump/jumpbump.dat
33
34 uninstall:
35         rm /usr/games/jnbpack /usr/games/jnbunpack /usr/games/jumpnbump /usr/games/jnbmenu.tcl