From 04619d3d33612c0ea9fc7f30dd31f9dbe427e15b Mon Sep 17 00:00:00 2001
From: Anders Blomdell <anders.blomdell@control.lth.se>
Date: Tue, 17 Feb 2015 11:01:38 +0100
Subject: [PATCH] Java OSGI cleanups.

---
 lib/java/Makefile               | 29 ++++++++++++++++++-----------
 lib/java/osgi-manifest-2006.txt |  7 +++++++
 lib/java/osgi-manifest-2014.txt |  7 +++++++
 lib/java/osgi-manifest-all.txt  |  8 ++++++++
 lib/java/osgi-manifest.txt      |  8 --------
 5 files changed, 40 insertions(+), 19 deletions(-)
 create mode 100644 lib/java/osgi-manifest-2006.txt
 create mode 100644 lib/java/osgi-manifest-2014.txt
 create mode 100644 lib/java/osgi-manifest-all.txt
 delete mode 100644 lib/java/osgi-manifest.txt

diff --git a/lib/java/Makefile b/lib/java/Makefile
index fc0daff..50705cd 100644
--- a/lib/java/Makefile
+++ b/lib/java/Makefile
@@ -20,31 +20,38 @@ MODULES=Constant \
 
 all: labcomm.jar labcomm2014.jar labcomm2006.jar
 
-labcomm.jar: gen/JAVAC
+labcomm.jar: gen/JAVAC osgi-manifest-all.txt
 	echo $@
-	cd gen ; jar cfm ../$@ ../osgi-manifest.txt se/lth/control/labcomm/*.class se/lth/control/labcomm2006/*.class
+	cd gen ; jar cfm ../$@ ../osgi-manifest-all.txt \
+		se/lth/control/labcomm/*.class \
+		se/lth/control/labcomm2006/*.class
 
-labcomm2014.jar: gen/JAVAC
+labcomm2014.jar: gen/JAVAC osgi-manifest-2014.txt
 	echo $@
-	cd gen ; jar cfm ../$@ ../osgi-manifest.txt se/lth/control/labcomm/*.class
+	cd gen ; jar cfm ../$@ ../osgi-manifest-2014.txt \
+		se/lth/control/labcomm/*.class
 
-labcomm2006.jar: gen/JAVAC
+labcomm2006.jar: gen/JAVAC osgi-manifest-2006.txt
 	echo $@
-	cd gen ; jar cfm ../$@ ../osgi-manifest.txt se/lth/control/labcomm2006/*.class
+	cd gen ; jar cfm ../$@ ../osgi-manifest-2006.txt \
+		se/lth/control/labcomm2006/*.class
 
 gen:
 	mkdir gen
 
-gen/JAVAC: $(MODULES:%=se/lth/control/labcomm/%.java) $(MODULES:%=se/lth/control/labcomm2006/%.java) Makefile | gen
-	javac -cp ../../compiler/labcomm_compiler.jar -d gen $(filter %.java, $^) 
+gen/JAVAC: $(MODULES:%=se/lth/control/labcomm/%.java) \
+	   $(MODULES:%=se/lth/control/labcomm2006/%.java) \
+	   Makefile | gen
+	javac -cp ../../compiler/labcomm_compiler.jar -d gen \
+		$(filter %.java, $^) 
 	touch $@
 
 
 .PHONY: clean
-
 clean:
-	rm -rf labcomm.jar labcomm2006.jar labcomm2014.jar gen
+	rm -rf gen
 
 .PHONY: distclean
+distclean:
+	rm -rf labcomm.jar labcomm2006.jar labcomm2014.jar
 
-distclean: clean
diff --git a/lib/java/osgi-manifest-2006.txt b/lib/java/osgi-manifest-2006.txt
new file mode 100644
index 0000000..4ef6bda
--- /dev/null
+++ b/lib/java/osgi-manifest-2006.txt
@@ -0,0 +1,7 @@
+Bundle-Description: Provides Labcomm to bundles
+Bundle-ManifestVersion: 2
+Bundle-Name: Labcomm OSGi
+Bundle-SymbolicName: se.lth.control.labcomm2006
+Bundle-Vendor: LTH
+Bundle-Version: 1.0.0
+Export-Package: se.lth.control.labcomm2006;version="1.0.0"
diff --git a/lib/java/osgi-manifest-2014.txt b/lib/java/osgi-manifest-2014.txt
new file mode 100644
index 0000000..53d3954
--- /dev/null
+++ b/lib/java/osgi-manifest-2014.txt
@@ -0,0 +1,7 @@
+Bundle-Description: Provides Labcomm 2014 to bundles
+Bundle-ManifestVersion: 2
+Bundle-Name: Labcomm OSGi
+Bundle-SymbolicName: se.lth.control.labcomm2014
+Bundle-Vendor: LTH
+Bundle-Version: 1.0.0
+Export-Package: se.lth.control.labcomm;version="1.0.0"
diff --git a/lib/java/osgi-manifest-all.txt b/lib/java/osgi-manifest-all.txt
new file mode 100644
index 0000000..4a691e7
--- /dev/null
+++ b/lib/java/osgi-manifest-all.txt
@@ -0,0 +1,8 @@
+Bundle-Description: Provides Labcomm 2006/2014 to bundles
+Bundle-ManifestVersion: 2
+Bundle-Name: Labcomm OSGi
+Bundle-SymbolicName: se.lth.control.labcomm-all
+Bundle-Vendor: LTH
+Bundle-Version: 1.0.0
+Export-Package: se.lth.control.labcomm2006;version="1.0.0",
+ se.lth.control.labcomm;version="1.0.0"
diff --git a/lib/java/osgi-manifest.txt b/lib/java/osgi-manifest.txt
deleted file mode 100644
index 49ca3d6..0000000
--- a/lib/java/osgi-manifest.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Bundle-Description: Provides Labcomm to bundles
-Bundle-ManifestVersion: 2
-Bundle-Name: Labcomm OSGi
-Bundle-SymbolicName: se.lth.control.labcomm
-Bundle-Vendor: LTH
-Bundle-Version: 1.0.0
-Export-Package: se.lth.control.labcomm;version="1.0.0",se.lth.control.la
- bcomm2006;version="1.0.0"
-- 
GitLab