gra-projekt/Implementierung/Makefile

32 lines
585 B
Makefile
Raw Normal View History

2022-06-29 11:40:12 +02:00
2022-07-04 18:02:34 +02:00
SRC = src/main.c src/helper.c src/io.c src/md2.c src/md2_impls/md2_common.c src/md2_impls/md2_0.c
2022-06-29 14:47:58 +02:00
OBJ = ${subst src,build,${SRC:.c=.o}}
CC = gcc
2022-07-06 20:35:27 +02:00
CFLAGS = -Ilib -ggdb -std=c11 -g -Wall -Wextra -no-pie -O3
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
2022-07-04 18:02:34 +02:00
@mkdir -p build/md2_impls
2022-06-29 14:47:58 +02:00
${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