Project

General

Profile

« Previous | Next » 

Revision 1260

Makefiles: Use .SECONDARY with no prerequisites instead of setting a .PRECIOUS for each intermediate, to simplify turning off automatic deletion of intermediate files

View differences:

inputs/input.Makefile
45 45

  
46 46
all: _always maps ;
47 47

  
48
.SUFFIXES:
48
.SUFFIXES: # turn off built-in suffix rules
49
.SECONDARY: # don't automatically delete intermediate files
49 50

  
50 51
_always:
51 52
.PHONY: _always
......
57 58

  
58 59
%.out: %.make _always
59 60
	./$* >$@
60
.PRECIOUS: %.out
61 61

  
62 62
$(root)/%: _always
63 63
	+$(subMake)
......
92 92
$(wildcard maps/VegBIEN.*.csv))
93 93
tables := $(directMaps:maps/VegBIEN.%.csv=%)
94 94

  
95
.PRECIOUS: $(allViaMaps) $(directMaps)
96

  
97 95
maps :=
98 96

  
99 97
maps/VegBIEN.%.csv: maps/$(via).%.csv $(coreMap)
100 98
	$(root)/bin/join_union_sort <$+ >$@
101
.PRECIOUS: maps/VegBIEN.%.csv $(coreMap)
102 99

  
103 100
maps += $(autogenMaps)
104 101

  
......
106 103
	env ignore=1 $(root)/bin/union <$+|$(root)/bin/sort_map >$@
107 104
maps/$(via).%.full.csv: maps/$(via).%.csv # fallback if no self map
108 105
	$(CP) $< $@
109
.PRECIOUS: maps/$(via).%.full.csv maps/$(via).%.csv $(selfMap)
110 106

  
111 107
maps += $(patsubst maps/%.csv,maps/%.full.csv,$(viaMaps))
112 108

  
......
175 171

  
176 172
verify/%.out: $(mappings)/verify.%.sql _always
177 173
	$(verify)
178
.PRECIOUS: verify/%.out
179 174
# default:
180 175
verify/%.out: _always ;
181 176

  
......
184 179
ifneq ($(dbFile),)
185 180
%.ref: %.ref.sql
186 181
	$(dbAsBien) $(db) <$< >$@
187
.PRECIOUS: %.ref
188 182
endif
189 183

  
190 184
##### Testing
......
231 225
	$(call runTest,$(map2db))
232 226
tests += test/import.%.out
233 227

  
234
.PRECIOUS: $(tests)
235

  
236 228
testOutputs := $(foreach test,$(tests),$(tables:%=$(test)))
237 229

  
238 230
test: _always $(testOutputs) ;
inputs/Makefile
12 12

  
13 13
all:
14 14

  
15
.SUFFIXES:
15
.SUFFIXES: # turn off built-in suffix rules
16
.SECONDARY: # don't automatically delete intermediate files
16 17

  
17 18
_always:
18 19
.PHONY: _always
schemas/Makefile
11 11

  
12 12
all: _always $(all) ;
13 13

  
14
.SUFFIXES:
14
.SUFFIXES: # turn off built-in suffix rules
15
.SECONDARY: # don't automatically delete intermediate files
15 16

  
16 17
_always:
17 18
.PHONY: _always
......
23 24

  
24 25
%:: %.make
25 26
	./$< >$@
26
.PRECIOUS: %
27 27

  
28 28
##### VegBIEN DB
29 29

  
30
.PRECIOUS: vegbien.sql
31

  
32 30
empty = $(SED) -n \
33 31
's/^CREATE TABLE ([0-9A-Za-z_]+) \($$/TRUNCATE \1 CASCADE;/p' <$< >$@
34 32

  
Makefile
40 40

  
41 41
all:
42 42

  
43
.SUFFIXES:
43
.SUFFIXES: # turn off built-in suffix rules
44
.SECONDARY: # don't automatically delete intermediate files
44 45

  
45 46
_always:
46 47
.PHONY: _always
mappings/Makefile
12 12

  
13 13
all: _always $(coreMaps) join_maps ch_root_maps ;
14 14

  
15
.SUFFIXES:
15
.SUFFIXES: # turn off built-in suffix rules
16
.SECONDARY: # don't automatically delete intermediate files
16 17

  
17 18
_always:
18 19
.PHONY: _always
......
32 33
	$(bin)/in_place $< $(bin)/sort_map
33 34
	touch $@
34 35
	$(call review_,$<)
35
.PRECIOUS: .%.last_cleanup
36 36
else
37 37
$(coreMaps): _always
38 38
	$(MAKE) $(@:%=.%.last_cleanup)

Also available in: Unified diff