mksdiso icon indicating copy to clipboard operation
mksdiso copied to clipboard

Makefile doesn't compile

Open hackerb9 opened this issue 5 years ago • 1 comments

Bug 1: It is usually expected that make (with no arguments) will recompile the binaries from the source code. However, instead the Makefile prints an error suggesting the user run make package, make install, or make clean.

Bug 2: make clean ought to delete the binaries so that they will be rebuilt from source.

Bug 3: make install should depend on the binaries so that they will be rebuilt from source if they are missing.

hackerb9 avatar Oct 10 '19 21:10 hackerb9

Here's a minimal patch would maybe fix the problems. It's not ideal and I haven't been able to test it fully because compilation fails with gcc-8.3, but it's a start.

diff --git a/Makefile b/Makefile
index aa51c18..02e00b8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,19 @@
 VERSION=$(shell gawk '/^VERSION/ {print $1}' bin/mksdiso | cut -f2 -d\")
 BUILD_DIR=build/mksdiso-$(VERSION)-all
 
-default:
+default: build
+
+help:
 	@echo "Usage: make <package|install|clean>"
 	@echo "   package | Build debian Package"
 	@echo "   install | install to /usr/local/bin"
 	@echo "   clean   | cleanup package build directory"
 	exit 0
 
-package:
+build:
+	cd src; make
+
+package: build
 	mkdir -p $(BUILD_DIR)/usr/bin $(BUILD_DIR)/usr/share/mksdiso $(BUILD_DIR)/DEBIAN
 	cp debian/control $(BUILD_DIR)/DEBIAN/
 	cp bin/* $(BUILD_DIR)/usr/bin/
@@ -18,7 +23,7 @@ package:
 	dpkg-deb --build $(BUILD_DIR)
 
 # Local install, modifes mksdiso-data-path to /usr/local/share/mksdiso
-install:
+install: build
 	cp -r bin/* /usr/local/bin/
 	sed -i 's/^DATADIR=.*/DATADIR=\/usr\/local\/share\/mksdiso/' /usr/local/bin/mksdiso
 	mkdir -p /usr/local/share || true

hackerb9 avatar Oct 10 '19 21:10 hackerb9