posaune
authorMichael Wagner <info@wagnertech.de>
Mon, 7 Mar 2016 15:46:39 +0000 (16:46 +0100)
committerMichael Wagner <info@wagnertech.de>
Mon, 7 Mar 2016 15:46:39 +0000 (16:46 +0100)
tools/make/makefile [new file with mode: 0644]

diff --git a/tools/make/makefile b/tools/make/makefile
new file mode 100644 (file)
index 0000000..8b83ff7
--- /dev/null
@@ -0,0 +1,76 @@
+# Generic makefile for mBuild build process
+
+# defile default operations
+
+NOP = @echo "No operation for target $@"
+COMPILE = $(NOP)
+COPY = $(NOP)
+ZIP = zip -r $(project).zip $(project)
+DEB = fakeroot dpkg-deb --build $(project)
+
+#default parameters
+project = default
+SOURCES =
+COPY_PRE =
+
+# Load project specification
+include make.pre
+
+.SUFFIXES: .stamp .zip
+
+
+#-----------------------------------------------------------------
+# Hauptziele:
+#
+#               : ohne Parameter wird compiliert
+# - zip         : packt ZIP file
+# - deb         : packt Debian package
+#
+#-----------------------------------------------------------------
+
+compile: compile.stamp
+       # compile ist fertig
+
+zip: $(project).zip
+       # ZIP file ready
+
+deb: $(project).deb
+       # Debian package ready
+
+#-----------------------------------------------------------------
+# compile steps
+#-----------------------------------------------------------------
+
+compile.stamp: $(SOURCES)
+       $(COMPILE)
+       @touch compile.stamp
+
+#-----------------------------------------------------------------
+# pack steps
+#-----------------------------------------------------------------
+
+copy.stamp: $(COPY_PRE)
+       $(COPY) $(project)
+       @touch copy.stamp
+
+control.stamp: $(project).control
+       mkdir -p $(project)/DEBIAN
+       cp $(project).control $(project)/DEBIAN/control
+       if [ -f $(project).postinst ]; then cp $(project).postinst $(project)/DEBIAN/postinst; fi
+       @touch control.stamp
+
+$(project).zip: copy.stamp $(project)
+       $(ZIP)
+
+$(project).deb: copy.stamp control.stamp
+       $(DEB)
+       cp $(project).deb $(project)_$(version).deb
+
+#-----------------------------------------------------------------
+# utilities
+#-----------------------------------------------------------------
+clean:
+       -rm *.stamp 2>/dev/null
+       if [ -e $(project).zip ]; then rm $(project).zip; fi
+       if [ -e $(project) ]; then rm -rf $(project); fi
+