From 74ea6dc86646cee9915292d73d8c7afef01ef3e0 Mon Sep 17 00:00:00 2001 From: Sopár Adrián Date: Thu, 20 Jun 2024 09:28:14 +0200 Subject: First commit. This is mostly the state of the project as I left it around the end of 2019. --- Makefile | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8102aec --- /dev/null +++ b/Makefile @@ -0,0 +1,83 @@ +CC = gcc +CFLAGS = -Isrc $$(ncursesw5-config --cflags) +LIBS = $$(ncursesw5-config --libs) +#LIBS = -lncursesw + +PREFIX = /usr/local +MANPREFIX = $(PREFIX)/man + +all: bin/maze + +debug: CFLAGS += -Wall -DEBUG -g +debug: bin/maze + +app_sources = $(wildcard src/*.c src/game/*.c) +app_objects = $(patsubst src/%.c, bin/%.o, $(app_sources)) + +bin/maze: $(app_objects) + $(CC) $(CFLAGS) $^ -o $@ $(LIBS) + +bin/main.o: src/main.c bin + $(CC) $(CFLAGS) -c $< -o $@ + +bin/args.o: src/args.c bin + $(CC) $(CFLAGS) -c $< -o $@ + +bin/config.o: src/config.c bin + $(CC) $(CFLAGS) -c $< -o $@ + +bin/color.o: src/color.c bin + $(CC) $(CFLAGS) -c $< -o $@ + +bin/menu.o: src/menu.c bin + $(CC) $(CFLAGS) -c $< -o $@ + +bin/game/entry.o: src/game/entry.c bin/game + $(CC) $(CFLAGS) -c $< -o $@ + +bin/game/game.o: src/game/game.c bin/game + $(CC) $(CFLAGS) -c $< -o $@ + +bin/game/operations.o: src/game/operations.c bin/game + $(CC) $(CFLAGS) -c $< -o $@ + +bin/game/commands.o: src/game/commands.c bin/game + $(CC) $(CFLAGS) -c $< -o $@ + +bin/file.o: src/file.c bin + $(CC) $(CFLAGS) -c $< -o $@ + +bin/maze_generator.o: src/maze_generator.c bin + $(CC) $(CFLAGS) -c $< -o $@ + +bin/maze_solver.o: src/maze_solver.c bin + $(CC) $(CFLAGS) -c $< -o $@ + +bin/utilities.o: src/utilities.c bin + $(CC) $(CFLAGS) -c $< -o $@ + +bin: + mkdir -p $@ + +bin/game: + mkdir -p $@ + +clean: + rm -rf bin/* + +install: bin/maze + @echo INSTALL execuatble + mkdir -p $(PREFIX)/bin + cp $< $(PREFIX)/bin/maze + chmod 755 $(PREFIX)/bin/maze + @echo INSTALL man page + gzip -c doc/maze.1 > $(MANPREFIX)/man1/maze.1.gz + chmod 644 $(MANPREFIX)/man1/maze.1.gz + +uninstall: + @echo REMOVE execuatble + rm -f $(PREFIX)/bin/maze + @echo REMOVE man page + rm -f $(MANPREFIX)/man1/maze.1.gz + +.PHONY: clean install uninstall -- cgit v1.2.3