Project

General

Profile

« Previous | Next » 

Revision 1777

input.Makefile: Split Maps section into "Existing maps discovery" and "Maps building" sections. Sources: Added cat, cat-% to cat out sources.

View differences:

input.Makefile
106 106

  
107 107
reinstall: _always uninstall install ;
108 108

  
109
##### Sources
109
##### Existing maps discovery
110 110

  
111
srcs = $(shell $(bin)/sort_filenames $(wildcard $(exts:%=src/*.$*.%)))
112
isXml = $(filter %.xml,$(firstword $(srcs)))
113
catSrcs = cat$(if $(isXml),,_csv) $(srcs)
114

  
115
##### Maps
116

  
117 111
srcMap := maps/src.%.csv
118 112
fullViaMap := maps/%.full.csv
119 113
directMap := maps/VegBIEN.%.csv
......
133 127
$(wildcard maps/VegBIEN.*.csv))
134 128
tables := $(directMaps:maps/VegBIEN.%.csv=%)
135 129

  
130
##### Sources
131

  
132
srcs = $(shell $(bin)/sort_filenames $(wildcard $(exts:%=src/*.$*.%)))
133
isXml = $(filter %.xml,$(firstword $(srcs)))
134
catSrcs = $(bin)/cat$(if $(isXml),,_csv) $(srcs)
135
withCatSrcs = $(catSrcs:$(bin)/=$(bin)/with_) --
136

  
137
cat: $(addprefix cat-,$(tables)) _always ;
138

  
139
cat-%: _always
140
	$(catSrcs)
141

  
142
##### Maps building
143

  
136 144
srcMaps := $(wildcard maps/src.*.csv)
137 145

  
138 146
# Must come before $(root)/% to override it
......
198 206
+maps = $(filter maps/% $(mappings)/%,$(+_))
199 207
<in = $(firstword $(filter-out $(+maps),$(+_)))
200 208
map = $(if $(<in),<$(<in),\
201
$(if $(srcs),$(bin)/with_$(catSrcs) --,\
209
$(if $(srcs),$(withCatSrcs),\
202 210
$(if $(mapEnv),env $(mapEnv),\
203 211
$(error No input file src/*.$*.{$(exts)}))))\
204 212
$(root)/map $(+maps)

Also available in: Unified diff