font.c was created, and the Makefiles updated to reflect this. It contains reload_fon...
[xuni.git] / Makefile
blob41d0c9c5831df06032a4c8dfa9b53d3cae724d08
1 # Makefile for xuni, Linux version
3 SDLLIBPATH = /usr/lib
4 SDLINCPATH = /usr/include/SDL
6 CC = gcc
7 CFLAGS = -W -Wall -ansi -pedantic -g -I$(SDLINCPATH) -L$(SDLLIBPATH)
8 CLINK = -lm -lSDL -lSDL_image -lSDL_gfx -lSDL_ttf
10 GDB = cgdb
11 DIFF = kompare
13 OBJ = font.o game.o graphics.o gui.o loop.o menu.o options.o settings.o xuni.o
14 TARGET = xuni
15 ARGS =
17 # Default target: all
18 all: $(TARGET)
20 # Executable files
21 $(TARGET): $(OBJ)
22 $(CC) $(CFLAGS) -o $(TARGET) $(OBJ) $(CLINK)
24 # Source files
25 font.o: font.c font.h graphics.h settings.h gui.h xuni.h
26 game.o: game.c game.h graphics.h gui.h loop.h menu.h xuni.h
27 graphics.o: graphics.c font.h graphics.h gui.h settings.h xuni.h
28 gui.o: gui.c graphics.h gui.h
29 loop.o: loop.c font.h graphics.h game.h gui.h loop.h menu.h options.h xuni.h
30 menu.o: menu.c font.h graphics.h gui.h loop.h menu.h xuni.h
31 options.o: options.c options.h graphics.h gui.h loop.h font.h menu.h xuni.h
32 settings.o: settings.c graphics.h gui.h settings.h xuni.h
33 xuni.o: xuni.c font.h graphics.h gui.h loop.h menu.h settings.h xuni.h
35 # Other targets
36 run: $(TARGET)
37 ./$(TARGET)
38 runa: $(TARGET)
39 ./$(TARGET) $(ARGS)
40 debug: $(TARGET)
41 $(GDB) $(TARGET)
42 profile: clean $(TARGET)
43 ./$(TARGET)
44 tempfile --directory . --prefix prof- --suffix .out > profile.temp
45 gprof $(TARGET) > `cat profile.temp`
46 kprof -f `cat profile.temp`
47 rm $(TARGET)
48 clean:
49 -rm $(TARGET) $(OBJ)
51 # Linux-only targets
52 gccmm:
53 echo "gcc -MM" > gccmm.out
54 gcc -MM $(CFLAGS) *.c | perl -pe 's@\s+\S+/\S+@@g' | tr -d \\ \
55 | perl -pe 'chomp;print "\n" if(/:/ && $$n++)' | tr -s " " >> gccmm.out
56 echo >> gccmm.out
57 echo "Current Makefile" > gccmm_current.out
58 grep -E '^[^ ]+\.o: +.*\.c' $(MAKEFILE_LIST) >> gccmm_current.out
59 $(DIFF) gccmm_current.out gccmm.out
60 memcheck: $(TARGET)
61 valgrind --leak-check=full -v ./$(TARGET) 2>&1\
62 | tee valgrind.output | less
63 permissions:
64 chmod 644 `find -type f`
65 chmod 755 `find -type d` $(TARGET) $(TARGET).exe