Project

General

Profile

« Previous | Next » 

Revision 1969

input.Makefile: Sources: Fixed bug where cat was defined before $(tables), by moving Sources after Existing maps discovery and putting just $(inputFiles) and $(dbExport) from Sources at the beginning of Existing maps discovery

View differences:

inputs/input.Makefile
106 106
	$(call addDirWithIgnore,test,$$'*.out\n*.xml')
107 107
	$(call addDirWithIgnore,verify,$$'*.out')
108 108

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

  
111 111
inputFiles := $(wildcard $(exts:%=src/*.%))
112 112
ifeq ($(inputFiles),)
113 113
dbExport := $(firstword $(wildcard src/db.*.sql))
114 114
endif
115 115

  
116
srcs = $(shell $(bin)/sort_filenames $(wildcard $(exts:%=src/*.$*.%)))
117
isCsv = $(if $(srcs),$(if $(filter %.xml,$(srcs)),,1))
118
    # true if $(srcs) non-empty and contains no *.xml
119
catSrcs = $(bin)/cat$(if $(isCsv),_csv) $(srcs)
120
withCatSrcs = $(catSrcs:$(bin)/%=$(bin)/with_%) --
121

  
122
# Usage: `make {--silent|-s} cat` (removes echoed make commands)
123
cat: $(addprefix cat-,$(tables)) _always ;
124

  
125
cat-%: _always
126
	$(catSrcs)
127

  
128
##### Existing maps discovery
129

  
130 116
srcMap := maps/src.%.csv
131 117
fullViaMap := maps/%.full.csv
132 118
directMap := maps/VegBIEN.%.csv
......
145 131
$(wildcard maps/VegBIEN.*.csv))
146 132
tables := $(directMaps:maps/VegBIEN.%.csv=%)
147 133

  
134
##### Sources
135

  
136
srcs = $(shell $(bin)/sort_filenames $(wildcard $(exts:%=src/*.$*.%)))
137
isCsv = $(if $(srcs),$(if $(filter %.xml,$(srcs)),,1))
138
    # true if $(srcs) non-empty and contains no *.xml
139
catSrcs = $(bin)/cat$(if $(isCsv),_csv) $(srcs)
140
withCatSrcs = $(catSrcs:$(bin)/%=$(bin)/with_%) --
141

  
142
# Usage: `make {--silent|-s} cat` (removes echoed make commands)
143
cat: $(addprefix cat-,$(tables)) _always ;
144

  
145
cat-%: _always
146
	$(catSrcs)
147

  
148 148
##### Installation
149 149

  
150 150
install: _always src/install import/install ;

Also available in: Unified diff