From ea895bae94957d97e12c6bcda34b72afe8506808 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sun, 21 Feb 2021 12:52:27 +0000
Subject: duktape, fix installation paths


diff --git a/Makefile.sharedlibrary b/Makefile.sharedlibrary
index e7d365f..a79f19e 100644
--- a/Makefile.sharedlibrary
+++ b/Makefile.sharedlibrary
@@ -46,6 +46,8 @@ endif
 
 # Change to actual path for actual distribution packaging.
 INSTALL_PREFIX = /usr/local
+INCLUDEDIR = $(INSTALL_PREFIX)/include
+LIBDIR = $(INSTALL_PREFIX)/lib
 
 # The 'noline' variant may be more appropriate for some distributions; it
 # doesn't have #line directives in the combined source.
@@ -72,17 +74,17 @@ libduktaped.$(SO_REALNAME_SUFFIX):
 # Symlinks depend on platform conventions.
 .PHONY: install
 install: libduktape.$(SO_REALNAME_SUFFIX) libduktaped.$(SO_REALNAME_SUFFIX)
-	mkdir -p $(INSTALL_PREFIX)/lib/
-	cp $+ $(INSTALL_PREFIX)/lib/
-	rm -f $(INSTALL_PREFIX)/lib/libduktape.so $(INSTALL_PREFIX)/lib/libduktape.$(SO_SONAME_SUFFIX)
-	ln -s libduktape.$(SO_REALNAME_SUFFIX) $(INSTALL_PREFIX)/lib/libduktape.so
-	ln -s libduktape.$(SO_REALNAME_SUFFIX) $(INSTALL_PREFIX)/lib/libduktape.$(SO_SONAME_SUFFIX)
-	rm -f $(INSTALL_PREFIX)/lib/libduktaped.so $(INSTALL_PREFIX)/lib/libduktaped.$(SO_SONAME_SUFFIX)
-	ln -s libduktaped.$(SO_REALNAME_SUFFIX) $(INSTALL_PREFIX)/lib/libduktaped.so
-	ln -s libduktaped.$(SO_REALNAME_SUFFIX) $(INSTALL_PREFIX)/lib/libduktaped.$(SO_SONAME_SUFFIX)
-	mkdir -p $(INSTALL_PREFIX)/include/
-	cp $(DUKTAPE_SRCDIR)/duktape.h $(DUKTAPE_SRCDIR)/duk_config.h $(INSTALL_PREFIX)/include/
+	mkdir -p $(LIBDIR)/
+	cp $+ $(LIBDIR)/
+	rm -f $(LIBDIR)/libduktape.so $(LIBDIR)/libduktape.$(SO_SONAME_SUFFIX)
+	ln -s libduktape.$(SO_REALNAME_SUFFIX) $(LIBDIR)/libduktape.so
+	ln -s libduktape.$(SO_REALNAME_SUFFIX) $(LIBDIR)/libduktape.$(SO_SONAME_SUFFIX)
+	rm -f $(LIBDIR)/libduktaped.so $(LIBDIR)/libduktaped.$(SO_SONAME_SUFFIX)
+	ln -s libduktaped.$(SO_REALNAME_SUFFIX) $(LIBDIR)/libduktaped.so
+	ln -s libduktaped.$(SO_REALNAME_SUFFIX) $(LIBDIR)/libduktaped.$(SO_SONAME_SUFFIX)
+	mkdir -p $(INCLUDEDIR)/
+	cp $(DUKTAPE_SRCDIR)/duktape.h $(DUKTAPE_SRCDIR)/duk_config.h $(INCLUDEDIR)/
 
 CCOPTS = -I./examples/cmdline
 duk:
-	$(CC) $(CCOPTS) -I$(INSTALL_PREFIX)/include -L$(INSTALL_PREFIX)/lib -Wall -Wextra -Os -o $@ ./examples/cmdline/duk_cmdline.c -lduktape -lm
+	$(CC) $(CCOPTS) -I$(INCLUDEDIR) -L$(LIBDIR) -Wall -Wextra -Os -o $@ ./examples/cmdline/duk_cmdline.c -lduktape -lm
-- 
2.30.0

