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) \
|
2023-11-22 21:34:57 +00:00
|
|
|
$(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) \
|
2023-11-29 15:41:02 +00:00
|
|
|
$(foreach e, 00 01 02 03 04 05, build/c03/ex$e) \
|
2023-11-22 21:34:57 +00:00
|
|
|
|
2023-11-28 15:40:55 +00:00
|
|
|
MAKEFLAGS := -k
|
|
|
|
|
2023-11-21 21:08:07 +00:00
|
|
|
all: norme $(all_builds)
|
2023-11-21 20:40:57 +00:00
|
|
|
build:
|
|
|
|
mkdir $@
|
|
|
|
clean:
|
|
|
|
rm -rf build
|
2023-11-22 21:34:57 +00:00
|
|
|
.PHONY: all norme clean
|
2023-11-21 20:40:57 +00:00
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
2023-11-30 19:05:07 +00:00
|
|
|
build/c%: $(OFFSHORE_MAINS)/contrib/Unity/src/unity.c $(OFFSHORE_PROJECTS)/c$$*/*.c $$(OFFSHORE_MAINS)/c$$*.c $$(wildcard $(OFFSHORE_MAINS)/common/*.c)
|
2023-11-21 20:40:57 +00:00
|
|
|
mkdir -p $(@D)
|
2023-11-30 19:05:07 +00:00
|
|
|
$(CC) -o $@ $(CFLAGS_MANDATORY) -Icommon -Icontrib/Unity/src $(CFLAGS) $^
|
2023-11-22 15:59:54 +00:00
|
|
|
norme: $$(wildcard $(OFFSHORE_PROJECTS)/c*)
|
2023-11-28 15:40:55 +00:00
|
|
|
norminette $^ || true
|