version 0.7
[zeRace] / Makefile
index 0b67908..ec34343 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,37 @@
 CC=gcc
+SDLCONFIG=sdl-config
 
-all:zeRace server
+all:zeRace server bot_anticip bot_checkpoint optimize_checkpoint
 
-zeRace:zeRace.c network.h sdl.o car.o tracklist.o
-       $(CC) -ansi -Wall -o zeRace zeRace.c sdl.o car.o tracklist.o `sdl-config --cflags --libs` -lSDL_net -lSDL_mixer -lSDL_image -lSDL_gfx
+zeRace:zeRace.c network.h sdl.o car.o tracklist.o $(ICON)
+       $(CC) -o zeRace$(EXT) zeRace.c sdl.o car.o tracklist.o $(ICON) `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_mixer -lSDL_image -lSDL_gfx -L.
 
 server:server.c network.h sdl.o car.o tracklist.o
-       $(CC) -ansi -Wall -o server server.c sdl.o car.o tracklist.o `sdl-config --cflags --libs` -lSDL_net -lSDL_image
+       $(CC) -o server$(EXT) server.c sdl.o car.o tracklist.o `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_image -L.
+
+bot_anticip:bot_anticip.c bot.o sdl.o car.o tracklist.o
+       $(CC) -o bot_anticip$(EXT) bot_anticip.c bot.o sdl.o car.o tracklist.o `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_image -L.
+
+bot_checkpoint:bot_checkpoint.c bot.o sdl.o car.o tracklist.o
+       $(CC) -o bot_checkpoint$(EXT) bot_checkpoint.c bot.o sdl.o car.o tracklist.o `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_image -L.
+
+optimize_checkpoint:bot_checkpoint.c sdl.o car.o tracklist.o
+       $(CC) -O2 -DOPTIMIZE -o optimize_checkpoint$(EXT) bot_checkpoint.c sdl.o car.o tracklist.o `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_image -L.
 
 sdl.o:sdl.c sdl.h
-       $(CC) -ansi -Wall -c sdl.c `sdl-config --cflags`
+       $(CC) -c sdl.c `$(SDLCONFIG) --cflags`
 
-car.o:car.c car.h
-       $(CC) -ansi -Wall -c car.c `sdl-config --cflags`
+car.o:car.c car.h sdl.h
+       $(CC) -c car.c `$(SDLCONFIG) --cflags`
 
 tracklist.o:tracklist.c tracklist.h
-       $(CC) -ansi -Wall -c tracklist.c
+       $(CC) -c tracklist.c
+
+bot.o:bot.c sdl.o car.o tracklist.o
+       $(CC) -c bot.c `$(SDLCONFIG) --cflags`
+
+icon.o:icon.rc
+       $(WINDRES) -i icon.rc -o icon.o
 
 clean:
-       rm -f zeRace server *.o *.cfg
+       rm -f zeRace server bot_anticip bot_checkpoint optimize_checkpoint *.exe *.o *.cfg