32 lines
No EOL
607 B
Makefile
32 lines
No EOL
607 B
Makefile
|
|
|
|
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 src/md2_impls/md2_2.c
|
|
OBJ = ${subst src,build,${SRC:.c=.o}}
|
|
CC = gcc
|
|
CFLAGS = -Ilib -ggdb -std=c11 -g -Wall -Wextra -no-pie -O3
|
|
LDFLAGS =
|
|
|
|
all: md2
|
|
|
|
clean:
|
|
rm -rf md2 build
|
|
|
|
help:
|
|
@echo === Project Build Help ===
|
|
@echo
|
|
@echo Available targets:
|
|
@echo - all: build everything
|
|
@echo - clean: clean distfiles
|
|
@echo - help: show this help
|
|
|
|
build:
|
|
mkdir build
|
|
|
|
build/%.o: src/%.c
|
|
@mkdir -p build/md2_impls
|
|
${CC} -c ${CFLAGS} -o $@ $<
|
|
|
|
md2: ${OBJ}
|
|
${CC} -o $@ $(OBJ) ${LDFLAGS}
|
|
|
|
.PHONY: all clean help |