You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

50 lines
1.1 KiB

UNAME:=$(shell uname)
ifneq ($(UNAME),OpenBSD)
LDFLAGS=-ldl
CFLAGS=-O
else
LDFLAGS=$(shell sdl-config --libs) -dynamic
CFLAGS=$(shell sdl-config --cflags) -O
endif
WARNINGS=-Wall -Wextra -Wformat -Wpointer-sign -Wsign-compare
all : main dummy ai guidemo
api.h : dameschinoises.h dameschinoises.patch
patch -o api.h dameschinoises.h dameschinoises.patch
main : main.o stack.o arbitre.o gui
gcc main.o stack.o arbitre.o gui.o -o main -pedantic $(LDFLAGS) -lSDL -lSDL_image -lSDL_gfx -lSDL_ttf -lm $(WARNINGS)
main.o : main.c api.h
gcc -c main.c $(CFLAGS) $(WARNINGS)
stack.o : stack.c
gcc -c stack.c $(CFLAGS) $(WARNINGS)
arbitre.o : arbitre.c api.h
gcc -c arbitre.c $(CFLAGS) $(WARNINGS)
dummy : dummy.c
gcc dummy.c -o dummy -fPIC -shared -nostartfiles $(WARNINGS)
.PHONY : ai
ai:
make -C ai
gui : gui.c api.h
gcc -c gui.c $(CFLAGS) $(WARNINGS)
guidemo : guidemo.c gui
gcc guidemo.c gui.o -o guidemo $(CFLAGS) $(LDFLAGS) -lSDL -lSDL_image -lSDL_gfx -lSDL_ttf -lm $(WARNINGS)
clean :
rm -f *.o
make -C ai clean
mrproper :
rm -f *.o api.h main dummy guidemo
make -C ai mrproper