Project

General

Profile

« Previous | Next » 

Revision 1779

input.Makefile: Maps building: Autogen src maps with known table names. Sources: $(withCatSrcs): Fixed bug where substitution pattern did not contain %.

View differences:

input.Makefile
5 5
reverify ?= 1
6 6
exts ?= csv tsv txt xml
7 7
test_n ?= 2
8
tablesSort ?= plots organisms stems
8
tablesSort ?= plots organisms stems specimens
9 9

  
10 10
##### Vars/functions
11 11

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

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

  
......
141 141

  
142 142
##### Maps building
143 143

  
144
# Maps to (try to) build are added to this
145
maps :=
146

  
144 147
srcMaps := $(wildcard maps/src.*.csv)
145 148

  
149
mkSrcMap = env datasrc=$(datasrc) $(withCatSrcs) $(bin)/src_map >$@
150

  
151
# Autogen src maps with known table names
152
maps/src.%.csv: # no prereqs so only built if doesn't exist
153
	$(if $(srcs),$(if $(isXml),,$(mkSrcMap)))
154
# only build if CSV srcs exist for that table name
155
# Try all table names
156
maps += $(tablesSort:%=maps/src.%.csv)
157

  
146 158
# Must come before $(root)/% to override it
147 159
$(coreSelfMap): _always
148 160
	-+$(subMake)
......
160 172
	$(selfMake) $(@:maps/%=maps/.%.last_cleanup)
161 173
endif
162 174

  
163
maps :=
164

  
165 175
joinSrcMap = $(if $(wildcard maps/src.$*.csv),$(bin)/in_place $@\
166 176
$(bin)/intersect maps/src.$*.csv 0)
167 177

  

Also available in: Unified diff