1 # Makefile for xuni, Linux version
4 SDLINCPATH
= /usr
/include/SDL
7 CFLAGS
= -W
-Wall
-ansi
-pedantic
-g
-I
$(SDLINCPATH
) -L
$(SDLLIBPATH
)
8 CLINK
= -lm
-lSDL
-lSDL_image
-lSDL_gfx
-lSDL_ttf
13 OBJ
= font.o game.o graphics.o gui.o loop.o menu.o options.o settings.o xuni.o
22 $(CC
) $(CFLAGS
) -o
$(TARGET
) $(OBJ
) $(CLINK
)
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
42 profile
: clean $(TARGET
)
44 tempfile
--directory .
--prefix prof-
--suffix .out
> profile.temp
45 gprof
$(TARGET
) > `cat profile.temp`
46 kprof
-f
`cat profile.temp`
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
57 echo
"Current Makefile" > gccmm_current.out
58 grep
-E
'^[^ ]+\.o: +.*\.c' $(MAKEFILE_LIST
) >> gccmm_current.out
59 $(DIFF
) gccmm_current.out gccmm.out
61 valgrind
--leak-check
=full
-v .
/$(TARGET
) 2>&1\
62 | tee valgrind.output | less
64 chmod
644 `find -type f`
65 chmod
755 `find -type d` $(TARGET
) $(TARGET
).exe