summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile3
-rw-r--r--[-rwxr-xr-x]goatcflags.m4 (renamed from goatcflags)2
3 files changed, 5 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 3eb7487..ac52743 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 a.out
 goatc.so
+goatcflags.m4
diff --git a/Makefile b/Makefile
index 37f2fb0..c0b4a39 100644
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,9 @@ all: $(LIB)
 goatc.so: goatc.cc
 	${CXX} ${CXXFLAGS} $< ${LDLIBS} -o $@ -shared ${LDFLAGS}
 
+goatcflags: goatcflags.m4
+	m4 -D PREFIX=${PREFIX} $< > $@
+
 install: $(INSTALLED_LIB) $(INSTALLED_BIN)
 
 ${DESTDIR}${PREFIX}/lib/%: %
diff --git a/goatcflags b/goatcflags.m4
index 973d4f9..7febc49 100755..100644
--- a/goatcflags
+++ b/goatcflags.m4
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with GoatC.  If not, see <https://www.gnu.org/licenses/>.
 
-printf " -fplugin=goatc.so"
+printf '%s' '-fplugin=PREFIX/lib/goatc.so'
 for arg in "$@"
 do printf ' -fplugin-arg-goatc-%s' "$arg"
 done