2023-11-21 20:40:57 +00:00
|
|
|
#location of test mains
|
|
|
|
OFFSHORE_MAINS := .
|
|
|
|
# location of project directories
|
|
|
|
OFFSHORE_PROJECTS := ..
|
|
|
|
|
|
|
|
empty:=
|
|
|
|
space:= $(empty) $(empty)
|
|
|
|
CFLAGS_MANDATORY := -Wall -Wextra -Werror
|
2023-11-21 21:08:07 +00:00
|
|
|
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)
|
|
|
|
all: norme $(all_builds)
|
2023-11-21 20:40:57 +00:00
|
|
|
build:
|
|
|
|
mkdir $@
|
|
|
|
clean:
|
|
|
|
rm -rf build
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
build/c%: $(OFFSHORE_PROJECTS)/c$$(subst _,+,$$*)/*.c $$(OFFSHORE_MAINS)/c$$*.c
|
|
|
|
mkdir -p $(@D)
|
|
|
|
$(CC) -o $@ $(CFLAGS_MANDATORY) $(CFLAGS) $^
|
2023-11-21 21:08:07 +00:00
|
|
|
norme: $$(foreach c, 00 01, $(OFFSHORE_PROJECTS)/c$$c)
|
|
|
|
norminette -R CheckForbiddenSourceHeader $^
|
2023-11-21 20:40:57 +00:00
|
|
|
|
|
|
|
.PHONY: all norme clean
|