Skip to content
Snippets Groups Projects
Commit 66ceb3f2 authored by Nicolas M. Thiéry's avatar Nicolas M. Thiéry
Browse files

Deplacement fichiers generes automatiquement dans data/static + randomisation

parent 1866355a
Branches
No related tags found
No related merge requests found
SUBSTITUTION='s/I1/i/g; s/I2/j/g; s/I3/n/g; s/F1/f/g; s/D1/x/g; s/D2/y/g; s/D3/z/g;'
SUBSTITUTION='s/CI1/1/g; s/CI2/3/g; s/I1/j/g; s/I2/k/g; s/I3/i/g; s/F1/g/g; s/D1/x/g; s/D2/y/g; s/D3/z/g; s/S1/s/g; s/S2/s1/g; s/S3/s2/g; '
PROGRAMS=$(wildcard data/*.cpp)
INPUT_PROGRAMS=$(wildcard data/*input.cpp)
PROGRAMS_MASSAGED=$(PROGRAMS:data/%.cpp=static/%.cpp)
PROGRAM_ANSWERS=$(PROGRAMS:data/%.cpp=static/%.answer)
PROGRAMS_MASSAGED=$(PROGRAMS:data/%.cpp=data/static/%.cpp)
PROGRAM_ANSWERS=$(PROGRAMS:data/%.cpp=data/static/%.cpp.answer)
#ANSWER=$(INPUT_PROGRAMS:%=%.answer)
TARGETS=$(shell cd data; ls *.cpp | cut -d '_' -f 1 - | sort | uniq)
all: static/index $(PROGRAMS_MASSAGED) $(PROGRAM_ANSWERS)
all: data/static/index $(PROGRAMS_MASSAGED) $(PROGRAM_ANSWERS)
static/index: $(PROGRAMS)
cd data; \
if [ -f index ]; then rm index; fi; \
data/static/index: $(PROGRAMS) data/static
if [ -f $@ ]; then rm $@; fi; \
for target in $(TARGETS); do \
(echo "$$target: "`ls -m $${target}_*.cpp`) >> index; \
(echo "$$target: "`cd data; ls -m $${target}_*.cpp`) >> $@; \
done
static/%.answer: static/%
data/static:
mkdir $@
data/static/%.cpp.answer: data/static/% data/static
@echo execution de $<
@if echo $< | grep -q _input; then \
count=0; \
......@@ -29,16 +31,16 @@ static/%.answer: static/%
./$< > $@; \
fi
static/%.cpp: data/%.cpp
data/static/%.cpp: data/%.cpp
sed $(SUBSTITUTION) $< > $@
static/%: static/%.cpp
data/static/%: data/static/%.cpp
g++ -Wall -Wno-sign-compare -Wno-unused-value -pedantic -std=c++11 $< -o $@
.PRECIOUS: static/%
.PRECIOUS: data/static/%
clean:
-rm static/*
-rm data/static/*
# Pour restauration
archive:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment