diff options
author | venomade <venomade@venomade.com> | 2025-02-27 17:25:46 +0000 |
---|---|---|
committer | venomade <venomade@venomade.com> | 2025-02-27 17:25:46 +0000 |
commit | 259c727658485ea00d6ef8617ecab579be871470 (patch) | |
tree | 5f548781584cf942b0c8a9101eed124da902c9ce /Makefile |
Initial Commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b536ba0 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +PKGS = sdl2 +CFLAGS = -O3 -Wall -Wold-style-definition -ggdb -std=c11 -pedantic `pkg-config --cflags $(PKGS)` +LIBS = `pkg-config --libs sdl2` -lm + +# Source files for the simulator +SIM_SRC = $(wildcard src/simulator/*.c) src/game.c +SIM_OBJ = $(SIM_SRC:.c=.o) + +# Source files for the trainer +TRAIN_SRC = $(wildcard src/trainer/*.c) src/game.c +TRAIN_OBJ = $(TRAIN_SRC:.c=.o) + +# Source files for the inspector +INSPECT_SRC = $(wildcard src/inspector/*.c) src/game.c +INSPECT_OBJ = $(INSPECT_SRC:.c=.o) + + +# Targets for the executables +all: gp-simulator gp-trainer gp-inspector + +gp-simulator: $(SIM_OBJ) + $(CC) $(CFLAGS) -o $@ $^ $(LIBS) + +gp-trainer: $(TRAIN_OBJ) + $(CC) $(CFLAGS) -o $@ $^ $(LIBS) + +gp-inspector: $(INSPECT_OBJ) + $(CC) $(CFLAGS) -o $@ $^ $(LIBS) + +# Pattern rule for object files +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + rm -f $(SIM_OBJ) gp-simulator + rm -f $(TRAIN_OBJ) gp-trainer + rm -f $(INSPECT_OBJ) gp-inspector + rm -f log.dat |