gra-projekt/Implementierung/Makefile

32 lines
488 B
Makefile
Raw Normal View History

2022-06-29 11:40:12 +02:00
2022-06-29 14:47:58 +02:00
SRC = src/main.c src/helper.c src/io.c src/md2.c
OBJ = ${subst src,build,${SRC:.c=.o}}
CC = gcc
2022-06-29 21:29:15 +02:00
CFLAGS = -Ilib -ggdb
2022-06-29 14:47:58 +02:00
LDFLAGS =
2022-06-29 11:40:12 +02:00
2022-06-29 14:47:58 +02:00
all: md2
2022-06-29 11:40:12 +02:00
clean:
rm -rf md2 build
2022-06-29 11:40:12 +02:00
help:
2022-06-29 14:47:58 +02:00
@echo === Project Build Help ===
@echo
@echo Available targets:
@echo - all: build everything
@echo - clean: clean distfiles
@echo - help: show this help
2022-06-29 11:40:12 +02:00
2022-06-29 14:47:58 +02:00
build:
mkdir build
2022-06-29 11:40:12 +02:00
2022-06-29 14:47:58 +02:00
build/%.o: src/%.c
@mkdir -p build
${CC} -c ${CFLAGS} -o $@ $<
2022-06-29 11:40:12 +02:00
2022-06-29 14:47:58 +02:00
md2: ${OBJ}
${CC} -o $@ $(OBJ) ${LDFLAGS}
2022-06-29 11:40:12 +02:00
2022-06-29 14:47:58 +02:00
.PHONY: all clean help