c_piscine__offshore_mains/Makefile
Alexey Chubukov 20fcf7d906 more stuff
2023-11-28 19:40:55 +04:00

28 lines
758 B
Makefile

#location of test mains
OFFSHORE_MAINS := .
# location of project directories
OFFSHORE_PROJECTS := ..
empty:=
space:= $(empty) $(empty)
CFLAGS_MANDATORY := -Wall -Wextra -Werror
all_builds := $(foreach e, 00 01 02 03 04 05 06 07 08, build/c00/ex$e) \
$(foreach e, 00 01 02 03 04 05 06 07 08, build/c01/ex$e) \
$(foreach e, 00 01 02 03 04 05 06 07 08 09 10 11 12, build/c02/ex$e) \
MAKEFLAGS := -k
all: norme $(all_builds)
build:
mkdir $@
clean:
rm -rf build
.PHONY: all norme clean
.SECONDEXPANSION:
build/c%: $(OFFSHORE_PROJECTS)/c$$*/*.c $$(OFFSHORE_MAINS)/c$$*.c $$(wildcard $(OFFSHORE_MAINS)/common/*.c)
mkdir -p $(@D)
$(CC) -o $@ $(CFLAGS_MANDATORY) -Icommon $(CFLAGS) $^
norme: $$(wildcard $(OFFSHORE_PROJECTS)/c*)
norminette $^ || true