diff options
Diffstat (limited to 'src/Makefile.am')
-rw-r--r-- | src/Makefile.am | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index fc7c653..3b09b7b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,8 +10,14 @@ AM_CFLAGS = \ EXTRA_DIST = \ populate_hlr_db.pl \ + db_bootstrap.sed \ $(NULL) +BUILT_SOURCES = \ + db_bootstrap.h \ + $(NULL) +CLEANFILES = $(BUILT_SOURCES) + noinst_HEADERS = \ auc.h \ db.h \ @@ -24,6 +30,7 @@ noinst_HEADERS = \ ctrl.h \ hlr_vty.h \ hlr_vty_subscr.h \ + db_bootstrap.h \ $(NULL) bin_PROGRAMS = \ @@ -73,3 +80,14 @@ db_test_LDADD = \ $(LIBOSMOGSM_LIBS) \ $(SQLITE3_LIBS) \ $(NULL) + +BOOTSTRAP_SQL = $(top_srcdir)/sql/hlr.sql + +db_bootstrap.h: $(BOOTSTRAP_SQL) $(srcdir)/db_bootstrap.sed + echo "/* DO NOT EDIT THIS FILE. It is generated from osmo-hlr.git/sql/hlr.sql */" > "$@" + echo "#pragma once" >> "$@" + echo "static const char *stmt_bootstrap_sql[] = {" >> "$@" + cat "$(BOOTSTRAP_SQL)" \ + | sed -f "$(srcdir)/db_bootstrap.sed" \ + >> "$@" + echo "};" >> "$@" |