]> gitweb.hhaalo.de Git - scantopdf.git/commitdiff
optimize make file
authorBastian Dehn <hhaalo@arcor.de>
Tue, 19 May 2026 17:56:31 +0000 (19:56 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 19 May 2026 17:56:31 +0000 (19:56 +0200)
Makefile

index 7d63fe967166c85dda91af5f0f1ddfdc80073668..54f34ab528bad2d7eeb354049f8aec07715844e1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,14 @@
-VERSIONNR = 1.1.5
-EXTRA =
-BUILDVERSION = 1
-ARCHITECTURE = x86_64
-VERSION = $(VERSIONNR)$(EXTRA)
-PACKAGENAME = scantopdf-$(VERSION)-$(BUILDVERSION)$(EXTRA_VERSION)-$(ARCHITECTURE)
-
-BUILDDIR = build
-PACKAGEDIR = $(BUILDDIR)/$(PACKAGENAME)
-SRCDIR = src
-BINDIR = usr/local/bin
-SHAREDIR = usr/local/share
+VERSIONNR=1.1.5
+BUILDVERSION=1
+ARCHITECTURE=x86_64
+VERSION=$(VERSIONNR)
+PACKAGENAME=scantopdf-$(VERSION)-$(BUILDVERSION)$(EXTRA_VERSION)-$(ARCHITECTURE)
+BUILDDIR=build
+SRCDIR=src
+PACKAGEDIR=$(BUILDDIR)/$(PACKAGENAME)
+PREFIX=usr/local
+BINDIR=$(PREFIX)/bin
+SHAREDIR=$(PREFIX)/share
 
 ################################################################################
 
@@ -43,7 +42,7 @@ $(BUILDDIR)/parts/scanbasic.sh: \
 
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/scanbasic.sh \
-               > $(BUILDDIR)/parts/scanbasic.sh
+               > $(@)
 
 ################################################################################
 
@@ -53,8 +52,8 @@ $(PACKAGEDIR)/$(BINDIR)/scantopdf: \
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/scantopdf \
                | sed "s/@VERSION@/$(VERSION)/" \
-               > $(PACKAGEDIR)/$(BINDIR)/scantopdf
-       chmod 755 $(PACKAGEDIR)/$(BINDIR)/scantopdf
+               > $(@)
+       chmod 755 $(@)
 
 $(PACKAGEDIR)/$(BINDIR)/scantopdfgray: \
        $(BUILDDIR)/parts/scanbasic.sh
@@ -62,8 +61,8 @@ $(PACKAGEDIR)/$(BINDIR)/scantopdfgray: \
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/scantopdfgray \
                | sed "s/@VERSION@/$(VERSION)/" \
-               > $(PACKAGEDIR)/$(BINDIR)/scantopdfgray
-       chmod 755 $(PACKAGEDIR)/$(BINDIR)/scantopdfgray
+               > $(@)
+       chmod 755 $(@)
 
 $(PACKAGEDIR)/$(BINDIR)/scantopdfbw: \
        $(BUILDDIR)/parts/scanbasic.sh
@@ -71,31 +70,31 @@ $(PACKAGEDIR)/$(BINDIR)/scantopdfbw: \
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/scantopdfgray \
                | sed "s/@VERSION@/$(VERSION)/" \
-               > $(PACKAGEDIR)/$(BINDIR)/scantopdfbw
-       chmod 755 $(PACKAGEDIR)/$(BINDIR)/scantopdfbw
+               > $(@)
+       chmod 755 $(@)
 
 $(PACKAGEDIR)/$(BINDIR)/addocr:
 
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/addocr \
                | sed "s/@VERSION@/$(VERSION)/" \
-               > $(PACKAGEDIR)/$(BINDIR)/addocr
-       chmod 755 $(PACKAGEDIR)/$(BINDIR)/addocr
+               > $(@)
+       chmod 755 $(@)
 
 $(PACKAGEDIR)/$(BINDIR)/addkeywords:
 
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/addkeywords \
                | sed "s/@VERSION@/$(VERSION)/" \
-               > $(PACKAGEDIR)/$(BINDIR)/addkeywords
-       chmod 755 $(PACKAGEDIR)/$(BINDIR)/addkeywords
+               > $(@)
+       chmod 755 $(@)
 
 ################################################################################
 
 $(PACKAGEDIR)/$(SHAREDIR)/scantopdf/cutpage.html:
 
        mkdir -p $(@D)
-       cp $(SRCDIR)/cutpage.html $(PACKAGEDIR)/$(SHAREDIR)/scantopdf/cutpage.html
+       cp $(SRCDIR)/cutpage.html $(@)
 
 ################################################################################
 
@@ -104,7 +103,7 @@ $(PACKAGEDIR)/DEBIAN/control:
        mkdir -p $(@D)
        cat $(SRCDIR)/control   \
                | sed "s/@VERSION@/$(VERSION)/" \
-               > $(PACKAGEDIR)/DEBIAN/control
+               > $(@)
 
 $(BUILDDIR)/$(PACKAGENAME).deb: \
        $(PACKAGEDIR)/$(BINDIR)/scantopdf \