Project

General

Profile

« Previous | Next » 

Revision 4137

input.Makefile: Determine import order from sorted order of all non-hidden subdirs, instead of from fixed constant. This allows datasources to specify arbitrary tables, rather than being limited to 0.plots, 1.organisms, 2.stems, specimens.

View differences:

inputs/input.Makefile
13 13
use_staged ?= $(by_col)
14 14

  
15 15
# Makefile
16
tablesSort ?= 0.plots 1.organisms 2.stems specimens
17 16
exts ?= csv tsv txt xml
18 17
test_n ?= 2
19 18

  
......
58 57
--width=$(termCols),$(diff))
59 58

  
60 59
# BIEN commands
60
sortFilenames = $(shell $(bin)/sort_filenames $(1))
61 61
selfMap = $(bin)/cols 0 0
62 62
psqlOpts := --set ON_ERROR_STOP=1 --quiet
63 63
psqlAsBien := $(bin)/psql_vegbien $(psqlOpts)
......
103 103

  
104 104
##### Existing maps discovery
105 105

  
106
allSubdirs := $(call wildcard/,src/*/)
107
tables := $(call sortFilenames,$(filter-out _%,$(allSubdirs:src/%/=%)))
108

  
106 109
srcMaps := $(wildcard src/*/src.csv)
107 110

  
108 111
srcMap := src/%/src.csv
......
119 122
coreMap := $(mappings)/$(via)-VegBIEN.csv
120 123
coreSelfMap := $(mappings)/$(via).self.csv
121 124

  
122
viaMaps := $(wildcard $(tablesSort:%=src/%/map.csv))
125
viaMaps := $(wildcard $(tables:%=src/%/map.csv))
123 126
viaMaps += $(filter-out $(viaMaps),$(srcMaps:src/%/src.csv=src/%/map.csv))
124 127
viaMaps += $(filter-out $(viaMaps) $(fullViaMap),$(wildcard src/*/map.csv))
125 128

  
126 129
autogenMaps := $(subst map.,VegBIEN.,$(viaMaps))
127 130
directMaps := $(autogenMaps) $(filter-out $(autogenMaps),\
128 131
$(wildcard src/*/VegBIEN.csv))
129
tables := $(directMaps:src/%/VegBIEN.csv=%)
130 132

  
131 133
##### Sources
132 134

  
133
srcs = $(shell $(bin)/sort_filenames $(call srcsOnly,$(wildcard src/$*/*)))
135
srcs = $(call sortFilenames,$(call srcsOnly,$(wildcard src/$*/*)))
134 136
isCsv = $(if $(srcs),$(if $(filter %.xml,$(srcs)),,1))
135 137
    # true if $(srcs) non-empty and contains no *.xml
136 138
catSrcs = $(bin)/cat$(if $(isCsv),_csv) $(srcs)
......
187 189
# only build if CSV srcs exist for that table name
188 190
endif
189 191

  
190
# Try all table names
191
createOnlyMaps += $(tablesSort:%=src/%/src.csv)
192
createOnlyMaps += $(tables:%=src/%/src.csv)
192 193

  
193 194
# Must come before $(root)/% to override it
194 195
$(coreSelfMap): _always

Also available in: Unified diff