Project

General

Profile

« Previous | Next » 

Revision 7382

inputs/FIA/_src/Makefile: Added Table bundling targets to regroup CSVs by tables

View differences:

Makefile
9 9

  
10 10
##### General targets
11 11

  
12
all: _always extract ;
12
all: _always tables ;
13 13

  
14 14
##### Downloads
15 15

  
......
31 31

  
32 32
zips := $(wildcard $(allZips))
33 33
zips := $(if $(zips),$(zips),$(allZips))
34
dirs := $(zips:%.zip=%/)
34
dirs := $(zips:%.zip=%)
35 35

  
36 36
extract: _always $(dirs) ;
37 37

  
......
39 39
	$(if $(wildcard $@),,$(unzip))
40 40

  
41 41
##### Table bundling
42

  
43
csvPattern = $(dir)/$(dir)_%.CSV
44
csvPattern* = $(subst %,*,$(csvPattern))
45
dirCsvs = $(wildcard $(csvPattern*))
46
dirTables = $(patsubst $(csvPattern),%,$(dirCsvs))
47
tableNames := $(sort $(foreach dir,$(dirs),$(dirTables)))
48
tableDirs := $(tableNames:%=../%/)
49

  
50
tables: _always $(tableDirs) ;
51

  
52
tableCsvs = $(wildcard $(dirs:%=$(csvPattern)))
53

  
54
$(tableDirs): ../%/: _always
55
	$(call mkdir,$@)
56
	$(if $(tableCsvs),mv $(tableCsvs) $@)

Also available in: Unified diff