fixed Makefile for use with multiple projects
This commit is contained in:
parent
5ac251b7d6
commit
1ecadf1b71
8
Makefile
8
Makefile
@ -6,11 +6,11 @@ OFFSHORE_PROJECTS := ..
|
|||||||
empty:=
|
empty:=
|
||||||
space:= $(empty) $(empty)
|
space:= $(empty) $(empty)
|
||||||
CFLAGS_MANDATORY := -Wall -Wextra -Werror
|
CFLAGS_MANDATORY := -Wall -Wextra -Werror
|
||||||
all: $(foreach e, 00 01 02 03 04 05 06 07 08, build/c00/ex$e)
|
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)
|
||||||
build:
|
build:
|
||||||
mkdir $@
|
mkdir $@
|
||||||
norme:
|
|
||||||
norminette -R CheckForbiddenSourceHeader ../c$(subst _,$(space),)
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
|
||||||
@ -18,5 +18,7 @@ clean:
|
|||||||
build/c%: $(OFFSHORE_PROJECTS)/c$$(subst _,+,$$*)/*.c $$(OFFSHORE_MAINS)/c$$*.c
|
build/c%: $(OFFSHORE_PROJECTS)/c$$(subst _,+,$$*)/*.c $$(OFFSHORE_MAINS)/c$$*.c
|
||||||
mkdir -p $(@D)
|
mkdir -p $(@D)
|
||||||
$(CC) -o $@ $(CFLAGS_MANDATORY) $(CFLAGS) $^
|
$(CC) -o $@ $(CFLAGS_MANDATORY) $(CFLAGS) $^
|
||||||
|
norme: $$(foreach c, 00 01, $(OFFSHORE_PROJECTS)/c$$c)
|
||||||
|
norminette -R CheckForbiddenSourceHeader $^
|
||||||
|
|
||||||
.PHONY: all norme clean
|
.PHONY: all norme clean
|
||||||
|
Loading…
Reference in New Issue
Block a user