@@ -148,26 +148,23 @@ ifneq (,$(findstring profile,$(DEB_BUILD_OPTIONS)))
148
148
endif
149
149
150
150
# multi distribution support:
151
- # - remove prefixes for current distribution
152
- # - remove lines that exclude current distribution
153
- # - remove prefixes that exclude other distributions
151
+ # - remove lines with applicable excludes
152
+ # - remove prefixes with applicable includes
153
+ # - remove prefixes with not applicable excludes
154
154
# - remove remaining comments
155
155
156
+ CONTROL_EXPRESSIONS = $(DISTRIBUTION ) grass$(GRASSVER )
157
+
156
158
ifneq (,$(WITH_ORACLE ) )
157
- FILTER_ORACLE = \
158
- -e 's/^# (.* |)oracle( .*|)#//' \
159
- -e '/^#(.* |)!oracle( .*|)#/d'
159
+ CONTROL_EXPRESSIONS += oracle
160
160
endif
161
161
162
162
define gentemplate
163
163
$(2 ) : $(1 )
164
164
sed -r \
165
- -e 's/^# (.* |)$(DISTRIBUTION)( .*|)#//' \
166
- -e '/^#(.* |)!$(DISTRIBUTION)( .*|)#/d' \
167
- -e 's/^#(.* |)grass$(GRASSVER)( .*|)#//' \
168
- -e '/^#(.* |)!grass$(GRASSVER)( .*|)#/d' \
169
- $(FILTER_ORACLE) \
170
- -e 's/^#(.* |)![^ ]*( .*|)#//' \
165
+ -e '/# (.+ |)!($(subst $(eval) ,|,$(CONTROL_EXPRESSIONS)))( .+|)#/d' \
166
+ -e 's/#([^#]+ |)($(subst $(eval) ,|,$(CONTROL_EXPRESSIONS)))( [^#]+|)#//g' \
167
+ -e 's/#([^#]+ |)![^#]+( [^#]*|)#//g' \
171
168
-e '/^#/d' \
172
169
-e "s/\{DEB_BUILD_GNU_TYPE\}/$(DEB_BUILD_GNU_TYPE)/g" \
173
170
-e "s#\{QT_PLUGIN_DIR\}#$(QT_PLUGIN_DIR)#g" \
0 commit comments