- changed sully to decrement from 5 included to 0
- changed sully makefile to adapt to different starting decrement number
This commit is contained in:
@@ -1,16 +1,31 @@
|
||||
NAME = Sully
|
||||
SRCS = Sully.c
|
||||
CLONES = Sully_4.c \
|
||||
Sully_3.c \
|
||||
Sully_2.c \
|
||||
Sully_1.c \
|
||||
Sully_0.c
|
||||
|
||||
CLONES_D = clones
|
||||
# extract value of i inside Sully.c :
|
||||
CLONES_i = $(shell grep -oP 'int i = \K\d+' $(SRCS))
|
||||
# seq -s ' ' -w 5 -1 0 : output -> "5 4 3 2 1 0"
|
||||
CLONES_SEQ = $(shell seq -s ' ' -w $(CLONES_i) -1 0)
|
||||
# create liste of executables files : Sully_5 Sully_4 ...
|
||||
CLONES_X = $(addprefix $(NAME)_,$(CLONES_SEQ))
|
||||
CLONES = $(CLONES_C)
|
||||
# create liste of files : Sully_5.c Sully_4.c ...
|
||||
CLONES_C = $(addsuffix .c,$(CLONES_X))
|
||||
|
||||
CREATE_CLONE = ./$(NAME)
|
||||
RM_MORE = rm -f
|
||||
RM_MORE += Sully_4 \
|
||||
Sully_3 \
|
||||
Sully_2 \
|
||||
Sully_1 \
|
||||
Sully_0
|
||||
RM_MORE = rm -rf
|
||||
RM_MORE += $(CLONES_X)
|
||||
RM_MORE += ./$(CLONES_D)
|
||||
|
||||
include ../MakefileCommon
|
||||
|
||||
sully:
|
||||
$(MAKE) re
|
||||
rm -rf ./$(CLONES_D)
|
||||
mkdir -p ./$(CLONES_D)
|
||||
cd ./$(CLONES_D) ;\
|
||||
clang -Wall -Wextra -Werror ../Sully.c -o Sully ; ./Sully ;\
|
||||
ls -al | grep Sully | wc -l
|
||||
|
||||
.PHONY : sully
|
||||
|
||||
|
||||
Reference in New Issue
Block a user