2021-12-11 21:32:48 +01:00
|
|
|
.PHONY: default
|
|
|
|
default: all
|
|
|
|
|
2021-01-12 15:55:25 +01:00
|
|
|
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))
|
|
|
|
|
2019-08-19 10:45:55 +02:00
|
|
|
# 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
|
|
|
|
2021-01-12 15:55:25 +01:00
|
|
|
LIBS=$(GTK_LIBS) -lm
|
2019-06-03 10:09:00 +02:00
|
|
|
|
|
|
|
PROGS=balls
|
2023-06-13 13:50:07 +02:00
|
|
|
OBJS=balls.o c_index.o game.o gravity.o spaceship.o main.o polygons.o polygon_generator.o collisions.o color.o
|
2021-12-11 21:32:48 +01:00
|
|
|
|
2022-06-01 11:09:35 +02:00
|
|
|
# dependencies (gcc -MM *.cc)
|
|
|
|
balls.o: balls.cc game.h balls.h vec2d.h gravity.h
|
|
|
|
c_index.o: c_index.cc balls.h vec2d.h game.h c_index.h
|
2022-05-30 15:59:45 +02:00
|
|
|
game.o: game.cc game.h
|
2022-06-01 11:09:35 +02:00
|
|
|
gravity.o: gravity.cc gravity.h balls.h vec2d.h game.h
|
|
|
|
main.o: main.cc game.h balls.h vec2d.h c_index.h gravity.h spaceship.h
|
|
|
|
spaceship.o: spaceship.cc balls.h vec2d.h game.h
|
2022-05-30 15:59:45 +02:00
|
|
|
stats.o: stats.cc
|
2023-06-13 13:50:07 +02:00
|
|
|
polygons.o: polygons.cc polygons.h vec2d.h polygon_generator.h color.h
|
2023-03-14 23:10:31 +01:00
|
|
|
polygon_generator.o: polygon_generator.cc polygon_generator.h
|
2023-04-02 21:53:21 +02:00
|
|
|
collisions.o: collisions.cc collisions.h vec2d.h
|
2023-06-13 13:50:07 +02:00
|
|
|
color.o: color.cc color.h
|
2023-03-14 23:10:31 +01:00
|
|
|
|
2019-07-29 14:21:55 +02:00
|
|
|
|
2019-06-03 10:09:00 +02:00
|
|
|
.PHONY: run
|
|
|
|
run: balls
|
2023-05-18 11:23:54 +02:00
|
|
|
./balls polygons=1
|
2019-06-03 10:09:00 +02:00
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(PROGS)
|
|
|
|
|
2021-12-01 20:18:19 +01:00
|
|
|
balls: $(OBJS)
|
2022-05-30 18:03:41 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
|
2019-06-03 10:09:00 +02:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2021-12-01 20:18:19 +01:00
|
|
|
rm -f *.o $(PROGS) $(OBJS)
|