flying-balls/Makefile

38 lines
829 B
Makefile
Raw Normal View History

.PHONY: default
default: all
GTK_PACKAGES=gdk-pixbuf-2.0 gtk+-3.0
2019-06-03 10:09:00 +02:00
GTK_CFLAGS=$(shell pkg-config --cflags $(GTK_PACKAGES))
GTK_LIBS=$(shell pkg-config --libs $(GTK_PACKAGES))
# PROFILING_CFLAGS=-pg
2022-05-30 15:59:45 +02:00
CXXFLAGS=-Wall -g -O2 $(PROFILING_CFLAGS) $(GTK_CFLAGS)
2019-06-03 10:09:00 +02:00
LIBS=$(GTK_LIBS) -lm
2019-06-03 10:09:00 +02:00
PROGS=balls
OBJS=balls.o c_index.o game.o gravity.o spaceship.o main.o
# dependencies (gcc -MM *.c)
2022-05-30 15:59:45 +02:00
balls.o: balls.cc game.h balls.h gravity.h
c_index.o: c_index.cc balls.h game.h c_index.h
game.o: game.cc game.h
gravity.o: gravity.cc gravity.h game.h
main.o: main.cc game.h balls.h c_index.h gravity.h spaceship.h
spaceship.o: spaceship.cc balls.h game.h
stats.o: stats.cc
2019-07-29 14:21:55 +02:00
2019-06-03 10:09:00 +02:00
.PHONY: run
run: balls
./balls
.PHONY: all
all: $(PROGS)
balls: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
2019-06-03 10:09:00 +02:00
.PHONY: clean
clean:
rm -f *.o $(PROGS) $(OBJS)