https://github.com/kwwette/swiglal
Raw File
Tip revision: 51032121a91b3357b73748ad970c62ea2356a958 authored by Karl Wette on 05 June 2013, 19:38:11 UTC
generate_swiglal_iface.py: quote regular expressions as raw strings
Tip revision: 5103212
swiglal_header.am
# SWIG makefile rules for generating header lists.
# Author: Karl Wette, 2011, 2012

if SWIG_BUILD

# SWIG interface header list
swig_iface_headers = $(top_builddir)/swig/@PACKAGE_NAME@swig_headers.list

# generate SWIG interface header list
all install .PHONY : swig-iface-headers
swig-iface-headers :
	@modified=false; \
	if test -f $(swig_iface_headers); then \
		patt=`echo '^$(subdir):' | $(SED) 's|\.|\\.|g'`; \
		match=`$(SED) -n "\\|$$patt|p" $(swig_iface_headers)`; \
		if test "x$$match" = x; then \
			echo '$(subdir): $(swig_headers)' >> $(swig_iface_headers); \
			modified=true; \
		else \
			patt=`echo '^$(subdir): $(swig_headers)$$' | $(SED) 's|\.|\\.|g'`; \
			match=`$(SED) -n "\\|$$patt|p" $(swig_iface_headers)`; \
			if test "x$$match" = x; then \
				$(SED) -i 's|^$(subdir):.*$$|$(subdir): $(swig_headers)|' $(swig_iface_headers); \
				modified=true; \
			fi; \
		fi; \
	else \
		echo '$(subdir): $(swig_headers)' > $(swig_iface_headers); \
		modified=true; \
	fi; \
	if test "x$$modified" = xtrue; then \
		for file in `find $(top_builddir)/swig -type f -name '*swig*.deps'`; do \
			echo '#erased' > $$file; \
		done; \
	fi

endif # SWIG_BUILD
back to top