From adf7075906e93a5c9624e67a6757cb0ac29742f0 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Tue, 13 Sep 2016 18:08:23 -0400
Subject: [PATCH] handle the discrepancy between submodule name "lyonpotpourri"
 and libdir name "lyon" more gracefully

---
 externals/Makefile | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/externals/Makefile b/externals/Makefile
index 77a80f1fe..71a790fee 100644
--- a/externals/Makefile
+++ b/externals/Makefile
@@ -1174,34 +1174,37 @@ loaders-libdir_clean:
 
 #------------------------------------------------------------------------------#
 # LYON
-LYON_NAME=lyon
+# Ivica named the libdir "lyon" for Pd-l2ork, but the submodule is named
+# lyonpotpourri. So we must do extra work to differentiate the two...
+LYON_SRC=lyonpotpourri
+LYON_DEST=lyon
 
 lyonpotpourri:
-	make -C $(externals_src)/$(LYON_NAME) PD_PATH=$(pd_src)
+	make -C $(externals_src)/$(LYON_SRC) PD_PATH=$(pd_src)
 
 lyonpotpourri_install:
-	#make -C $(externals_src)/$(LYON_NAME) DESTDIR="$(DESTDIR)" \
+	#make -C $(externals_src)/$(LYON_SRC) DESTDIR="$(DESTDIR)" \
 	#	objectsdir="$(objectsdir)" install
-	install -d $(DESTDIR)$(objectsdir)/$(LYON_NAME)
-	install -d $(DESTDIR)$(objectsdir)/$(LYON_NAME)/sound
-	install -p $(wildcard $(externals_src)/$(LYON_NAME)/*.$(EXTENSION)) \
-		$(DESTDIR)$(objectsdir)/$(LYON_NAME)
-	install -p $(externals_src)/$(LYON_NAME)/lyonpotpourri-helpfiles/*.pd \
-		$(DESTDIR)$(objectsdir)/$(LYON_NAME)
+	install -d $(DESTDIR)$(objectsdir)/$(LYON_DEST)
+	install -d $(DESTDIR)$(objectsdir)/$(LYON_DEST)/sound
+	install -p $(wildcard $(externals_src)/$(LYON_SRC)/*.$(EXTENSION)) \
+		$(DESTDIR)$(objectsdir)/$(LYON_DEST)
+	install -p $(externals_src)/$(LYON_SRC)/lyonpotpourri-helpfiles/*.pd \
+		$(DESTDIR)$(objectsdir)/$(LYON_DEST)
 	# don't include cartopol/poltocar-- cyclone library already has those
-	rm $(DESTDIR)$(objectsdir)/$(LYON_NAME)/cartopol*.$(EXTENSION)
-	rm $(DESTDIR)$(objectsdir)/$(LYON_NAME)/poltocar*.$(EXTENSION)
-	install -p $(externals_src)/$(LYON_NAME)/lyonpotpourri-helpfiles/sound/*.* \
-		$(DESTDIR)$(objectsdir)/$(LYON_NAME)/sound
+	rm $(DESTDIR)$(objectsdir)/$(LYON_DEST)/cartopol*.$(EXTENSION)
+	rm $(DESTDIR)$(objectsdir)/$(LYON_DEST)/poltocar*.$(EXTENSION)
+	install -p $(externals_src)/$(LYON_SRC)/lyonpotpourri-helpfiles/sound/*.* \
+		$(DESTDIR)$(objectsdir)/$(LYON_DEST)/sound
 	# copy the meta file and the shared lib
-	install -p $(externals_src)/$(LYON_NAME)/*lyonpotpourri.* \
-		$(DESTDIR)$(objectsdir)/$(LYON_NAME)
+	install -p $(externals_src)/$(LYON_SRC)/*lyonpotpourri.* \
+		$(DESTDIR)$(objectsdir)/$(LYON_DEST)
 	# license and readme
-	install -p $(externals_src)/$(LYON_NAME)/*.txt \
-		$(DESTDIR)$(objectsdir)/$(LYON_NAME)
+	install -p $(externals_src)/$(LYON_SRC)/*.txt \
+		$(DESTDIR)$(objectsdir)/$(LYON_DEST)
 
 lyonpotpourri_clean:
-	make -C $(externals_src)/$(LYON_NAME) clean
+	make -C $(externals_src)/$(LYON_SRC) clean
 
 #------------------------------------------------------------------------------#
 # MAPPING
-- 
GitLab