summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Reimer <manuel.reimer@gmx.de>2018-04-07 11:40:46 +0200
committerManuel Reimer <manuel.reimer@gmx.de>2018-04-07 11:40:46 +0200
commitcebab6f35a4b3e343d1a85cad21919a3dc5122c8 (patch)
treed9b6f5f33507176a928e3e5823e29b1612617762
parent9a67086fa751ccbb4a0a6fe1e25127730c049b3e (diff)
downloadgraphlcd-base-cebab6f35a4b3e343d1a85cad21919a3dc5122c8.tar.gz
graphlcd-base-cebab6f35a4b3e343d1a85cad21919a3dc5122c8.tar.bz2
Final Makefile fixes. Packaging should be much easier now
-rw-r--r--Make.config10
-rw-r--r--Makefile17
-rw-r--r--glcddrivers/Makefile22
-rw-r--r--glcdgraphics/Makefile24
-rw-r--r--glcdskin/Makefile23
-rw-r--r--tools/Makefile5
-rw-r--r--tools/convpic/Makefile9
-rw-r--r--tools/crtfont/Makefile9
-rw-r--r--tools/genfont/Makefile11
-rw-r--r--tools/lcdtestpattern/Makefile9
-rw-r--r--tools/showpic/Makefile9
-rw-r--r--tools/showtext/Makefile9
-rw-r--r--tools/skintest/Makefile8
13 files changed, 83 insertions, 82 deletions
diff --git a/Make.config b/Make.config
index b5f0869..4f90b4c 100644
--- a/Make.config
+++ b/Make.config
@@ -33,10 +33,12 @@ LDCONFIG = ldconfig
DESTDIR ?=
PREFIX ?= /usr/local
-BINDIR = $(DESTDIR)$(PREFIX)/bin
-LIBDIR = $(DESTDIR)$(PREFIX)/lib
-INCDIR = $(DESTDIR)$(PREFIX)/include
-MANDIR = $(DESTDIR)$(PREFIX)/share/man
+BINDIR ?= $(PREFIX)/bin
+LIBDIR ?= $(PREFIX)/lib
+INCDIR ?= $(PREFIX)/include
+MANDIR ?= $(PREFIX)/share/man
+UDEVRULESDIR ?= /etc/udev/rules.d
+SYSCONFDIR ?= /etc
### Includes and defines
diff --git a/Makefile b/Makefile
index 82f06b4..6d4363e 100644
--- a/Makefile
+++ b/Makefile
@@ -2,14 +2,15 @@
# Makefile for the GraphLCD driver library, graphics library and tools
#
+include Make.config
+
PROJECT = graphlcd-base
VERSION = 0.3.0
ARCHIVE = $(PROJECT)-$(VERSION)
PACKAGE = $(ARCHIVE)
TMPDIR = /tmp
-UDEVRULESDIR ?= /etc/udev/rules.d/
-UDEVRULE ?= 99-graphlcd-base.rules
+UDEVRULE = 99-graphlcd-base.rules
### Targets:
@@ -24,14 +25,21 @@ install:
@$(MAKE) -C glcddrivers install
@$(MAKE) -C glcdskin install
@$(MAKE) -C tools install
- test -d "${UDEVRULESDIR}" && install -m 644 -o root -g root "$(UDEVRULE)" "$(UDEVRULESDIR)"
+# Checking for UDEVRULESDIR without DESTDIR (check if build system uses systemd)
+ifneq ($(wildcard $(UDEVRULESDIR)/.),)
+ install -d $(DESTDIR)$(UDEVRULESDIR)
+ install -m 644 $(UDEVRULE) $(DESTDIR)$(UDEVRULESDIR)
+endif
+ install -d $(DESTDIR)$(SYSCONFDIR)
+ cp -n graphlcd.conf $(DESTDIR)$(SYSCONFDIR)
uninstall:
@$(MAKE) -C glcdgraphics uninstall
@$(MAKE) -C glcddrivers uninstall
@$(MAKE) -C glcdskin uninstall
@$(MAKE) -C tools uninstall
-
+ rm -f $(DESTDIR)$(UDEVRULESDIR)/$(UDEVRULE)
+
clean:
@-rm -f *.tgz
@$(MAKE) -C glcdgraphics clean
@@ -46,4 +54,3 @@ dist: clean
@tar czf $(PACKAGE).tgz --exclude .svn --exclude *.cbp --exclude *.layout -C $(TMPDIR) $(ARCHIVE)
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution package created as $(PACKAGE).tgz
-
diff --git a/glcddrivers/Makefile b/glcddrivers/Makefile
index 155ce98..c70ad8e 100644
--- a/glcddrivers/Makefile
+++ b/glcddrivers/Makefile
@@ -2,7 +2,7 @@
# Makefile for the GraphLCD driver library
#
--include ../Make.config
+include ../Make.config
CXXFLAGS += -fPIC
@@ -83,18 +83,18 @@ $(LIBNAME): $(OBJS)
ln -sf $(LIBNAME) $(BASENAME)
install: all
- install -d $(LIBDIR)
- install -m 755 $(LIBNAME) $(LIBDIR)/
- install -d $(INCDIR)/glcddrivers
- install -m 644 $(HEADERS) $(INCDIR)/glcddrivers/
- ( cd $(LIBDIR); ln -sf $(LIBNAME) $(BASENAME).$(VERMAJOR); ln -sf $(LIBNAME) $(BASENAME) )
+ install -d $(DESTDIR)$(LIBDIR)
+ install -m 755 $(LIBNAME) $(DESTDIR)$(LIBDIR)/
+ install -d $(DESTDIR)$(INCDIR)/glcddrivers
+ install -m 644 $(HEADERS) $(DESTDIR)$(INCDIR)/glcddrivers/
+ ( cd $(DESTDIR)$(LIBDIR); ln -sf $(LIBNAME) $(BASENAME).$(VERMAJOR); ln -sf $(LIBNAME) $(BASENAME) )
uninstall:
- rm -f $(LIBDIR)/$(BASENAME)
- rm -f $(LIBDIR)/$(BASENAME).$(VERMAJOR)
- rm -f $(LIBDIR)/$(LIBNAME)
- (for i in $(HEADERS); do rm -f $(INCDIR)/glcddrivers/$$i; done)
- rmdir $(INCDIR)/glcddrivers
+ rm -f $(DESTDIR)$(LIBDIR)/$(BASENAME)
+ rm -f $(DESTDIR)$(LIBDIR)/$(BASENAME).$(VERMAJOR)
+ rm -f $(DESTDIR)$(LIBDIR)/$(LIBNAME)
+ (for i in $(HEADERS); do rm -f $(DESTDIR)$(INCDIR)/glcddrivers/$$i; done)
+ rmdir $(DESTDIR)$(INCDIR)/glcddrivers
clean:
rm -f $(OBJS) $(DEPFILE) $(LIBNAME) $(BASENAME) *~
diff --git a/glcdgraphics/Makefile b/glcdgraphics/Makefile
index 2d6e7ff..cba3a37 100644
--- a/glcdgraphics/Makefile
+++ b/glcdgraphics/Makefile
@@ -2,11 +2,11 @@
# Makefile for the GraphLCD graphics library
#
--include ../Make.config
+include ../Make.config
# External image lib to use: imagemagick, graphicsmagick, or none
# (two ifdef/endif are used because older installations may not support 'else ifdef')
-IMAGELIB =
+IMAGELIB =
ifdef HAVE_GRAPHICSMAGICK
IMAGELIB = graphicsmagick
endif
@@ -73,18 +73,18 @@ $(LIBNAME): $(OBJS)
ln -sf $(LIBNAME) $(BASENAME)
install: all
- install -d $(LIBDIR)
- install -m 755 $(LIBNAME) $(LIBDIR)/
- install -d $(INCDIR)/glcdgraphics
- install -m 644 $(HEADERS) $(INCDIR)/glcdgraphics/
- ( cd $(LIBDIR); ln -sf $(LIBNAME) $(BASENAME).$(VERMAJOR); ln -sf $(LIBNAME) $(BASENAME) )
+ install -d $(DESTDIR)$(LIBDIR)
+ install -m 755 $(LIBNAME) $(DESTDIR)$(LIBDIR)/
+ install -d $(DESTDIR)$(INCDIR)/glcdgraphics
+ install -m 644 $(HEADERS) $(DESTDIR)$(INCDIR)/glcdgraphics/
+ ( cd $(DESTDIR)$(LIBDIR); ln -sf $(LIBNAME) $(BASENAME).$(VERMAJOR); ln -sf $(LIBNAME) $(BASENAME) )
uninstall:
- rm -f $(LIBDIR)/$(BASENAME)
- rm -f $(LIBDIR)/$(BASENAME).$(VERMAJOR)
- rm -f $(LIBDIR)/$(LIBNAME)
- (for i in $(HEADERS); do rm -f $(INCDIR)/glcdgraphics/$$i; done)
- rmdir $(INCDIR)/glcdgraphics
+ rm -f $(DESTDIR)$(LIBDIR)/$(BASENAME)
+ rm -f $(DESTDIR)$(LIBDIR)/$(BASENAME).$(VERMAJOR)
+ rm -f $(DESTDIR)$(LIBDIR)/$(LIBNAME)
+ (for i in $(HEADERS); do rm -f $(DESTDIR)$(INCDIR)/glcdgraphics/$$i; done)
+ rmdir $(DESTDIR)$(INCDIR)/glcdgraphics
clean:
rm -f $(OBJS) $(DEPFILE) $(LIBNAME) $(BASENAME) *~
diff --git a/glcdskin/Makefile b/glcdskin/Makefile
index 90fe310..d80ffea 100644
--- a/glcdskin/Makefile
+++ b/glcdskin/Makefile
@@ -2,8 +2,7 @@
# Makefile for the GraphLCD skin library
#
--include ../Make.config
-
+include ../Make.config
CXXFLAGS += -fPIC
@@ -48,18 +47,18 @@ $(LIBNAME): $(OBJS)
ln -sf $(LIBNAME) $(BASENAME)
install: all
- install -d $(LIBDIR)
- install -m 755 $(LIBNAME) $(LIBDIR)/
- install -d $(INCDIR)/glcdskin
- install -m 644 $(HEADERS) $(INCDIR)/glcdskin/
- ( cd $(LIBDIR); ln -sf $(LIBNAME) $(BASENAME).$(VERMAJOR); ln -sf $(LIBNAME) $(BASENAME) )
+ install -d $(DESTDIR)$(LIBDIR)
+ install -m 755 $(LIBNAME) $(DESTDIR)$(LIBDIR)/
+ install -d $(DESTDIR)$(INCDIR)/glcdskin
+ install -m 644 $(HEADERS) $(DESTDIR)$(INCDIR)/glcdskin/
+ ( cd $(DESTDIR)$(LIBDIR); ln -sf $(LIBNAME) $(BASENAME).$(VERMAJOR); ln -sf $(LIBNAME) $(BASENAME) )
uninstall:
- rm -f $(LIBDIR)/$(BASENAME)
- rm -f $(LIBDIR)/$(BASENAME).$(VERMAJOR)
- rm -f $(LIBDIR)/$(LIBNAME)
- (for i in $(HEADERS); do rm -f $(INCDIR)/glcdskin/$$i; done)
- rmdir $(INCDIR)/glcdskin
+ rm -f $(DESTDIR)$(LIBDIR)/$(BASENAME)
+ rm -f $(DESTDIR)$(LIBDIR)/$(BASENAME).$(VERMAJOR)
+ rm -f $(DESTDIR)$(LIBDIR)/$(LIBNAME)
+ (for i in $(HEADERS); do rm -f $(DESTDIR)$(INCDIR)/glcdskin/$$i; done)
+ rmdir $(DESTDIR)$(INCDIR)/glcdskin
clean:
rm -f $(OBJS) $(DEPFILE) $(LIBNAME) $(BASENAME) *~
diff --git a/tools/Makefile b/tools/Makefile
index d923139..139378a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -3,7 +3,7 @@
#
--include ../Make.config
+include ../Make.config
### Targets:
@@ -39,7 +39,7 @@ endif
@$(MAKE) -C showtext uninstall
@$(MAKE) -C lcdtestpattern uninstall
@$(MAKE) -C skintest uninstall
-
+
clean:
@$(MAKE) -C convpic clean
@$(MAKE) -C crtfont clean
@@ -48,4 +48,3 @@ clean:
@$(MAKE) -C showtext clean
@$(MAKE) -C lcdtestpattern clean
@$(MAKE) -C skintest clean
-
diff --git a/tools/convpic/Makefile b/tools/convpic/Makefile
index 3d57aa4..eb91742 100644
--- a/tools/convpic/Makefile
+++ b/tools/convpic/Makefile
@@ -2,7 +2,7 @@
# Makefile for the GraphLCD tool convpic
#
--include ../../Make.config
+include ../../Make.config
PRGNAME = convpic
@@ -32,12 +32,11 @@ $(PRGNAME): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -rdynamic $(OBJS) $(LIBS) $(LIBDIRS) -lglcdgraphics -lstdc++ -o $(PRGNAME)
install: $(PRGNAME)
- install -d $(BINDIR)
- install -m 755 -o root -g root $(HAVE_STRIP) $(PRGNAME) $(BINDIR)
+ install -d $(DESTDIR)$(BINDIR)
+ install -m 755 $(HAVE_STRIP) $(PRGNAME) $(DESTDIR)$(BINDIR)
uninstall:
- rm -f $(BINDIR)/$(PRGNAME)
+ rm -f $(DESTDIR)$(BINDIR)/$(PRGNAME)
clean:
@-rm -f $(OBJS) $(DEPFILE) $(PRGNAME) *~
-
diff --git a/tools/crtfont/Makefile b/tools/crtfont/Makefile
index 6c6abdf..614c135 100644
--- a/tools/crtfont/Makefile
+++ b/tools/crtfont/Makefile
@@ -2,7 +2,7 @@
# Makefile for the GraphLCD tool crtfont
#
--include ../../Make.config
+include ../../Make.config
PRGNAME = crtfont
@@ -31,12 +31,11 @@ $(PRGNAME): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -rdynamic $(OBJS) $(LIBDIRS) -lglcdgraphics -lstdc++ -o $(PRGNAME)
install: $(PRGNAME)
- install -d $(BINDIR)
- install -m 755 -o root -g root $(HAVE_STRIP) $(PRGNAME) $(BINDIR)
+ install -d $(DESTDIR)$(BINDIR)
+ install -m 755 $(HAVE_STRIP) $(PRGNAME) $(DESTDIR)$(BINDIR)
uninstall:
- rm -f $(BINDIR)/$(PRGNAME)
+ rm -f $(DESTDIR)$(BINDIR)/$(PRGNAME)
clean:
@-rm -f $(OBJS) $(DEPFILE) $(PRGNAME) *~
-
diff --git a/tools/genfont/Makefile b/tools/genfont/Makefile
index f97d8e7..c4aab2f 100644
--- a/tools/genfont/Makefile
+++ b/tools/genfont/Makefile
@@ -2,7 +2,7 @@
# Makefile for the GraphLCD tool crtfont
#
--include ../../Make.config
+include ../../Make.config
PRGNAME = genfont
@@ -34,12 +34,11 @@ $(PRGNAME): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -rdynamic $(OBJS) $(LIBDIRS) $(LIBS) -lglcdgraphics -lstdc++ -o $(PRGNAME)
install: $(PRGNAME)
- install -d $(BINDIR)
- install -m 755 -o root -g root $(HAVE_STRIP) $(PRGNAME) $(BINDIR)
-
+ install -d $(DESTDIR)$(BINDIR)
+ install -m 755 $(HAVE_STRIP) $(PRGNAME) $(DESTDIR)$(BINDIR)
+
uninstall:
- rm -f $(BINDIR)/$(PRGNAME)
+ rm -f $(DESTDIR)$(BINDIR)/$(PRGNAME)
clean:
@-rm -f $(OBJS) $(DEPFILE) $(PRGNAME) *~
-
diff --git a/tools/lcdtestpattern/Makefile b/tools/lcdtestpattern/Makefile
index e29305b..29fe792 100644
--- a/tools/lcdtestpattern/Makefile
+++ b/tools/lcdtestpattern/Makefile
@@ -2,7 +2,7 @@
# Makefile for the GraphLCD tool showpic
#
--include ../../Make.config
+include ../../Make.config
PRGNAME = lcdtestpattern
@@ -32,12 +32,11 @@ $(PRGNAME): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -rdynamic $(OBJS) $(LIBS) $(LIBDIRS) -lglcddrivers -lglcdgraphics -lstdc++ -o $(PRGNAME)
install: $(PRGNAME)
- install -d $(BINDIR)
- install -m 755 -o root -g root $(HAVE_STRIP) $(PRGNAME) $(BINDIR)
+ install -d $(DESTDIR)$(BINDIR)
+ install -m 755 $(HAVE_STRIP) $(PRGNAME) $(DESTDIR)$(BINDIR)
uninstall:
- rm -f $(BINDIR)/$(PRGNAME)
+ rm -f $(DESTDIR)$(BINDIR)/$(PRGNAME)
clean:
@-rm -f $(OBJS) $(DEPFILE) $(PRGNAME) *~
-
diff --git a/tools/showpic/Makefile b/tools/showpic/Makefile
index de7560a..967ecf9 100644
--- a/tools/showpic/Makefile
+++ b/tools/showpic/Makefile
@@ -2,7 +2,7 @@
# Makefile for the GraphLCD tool showpic
#
--include ../../Make.config
+include ../../Make.config
PRGNAME = showpic
@@ -32,12 +32,11 @@ $(PRGNAME): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -rdynamic $(OBJS) $(LIBS) $(LIBDIRS) -lglcdgraphics -lglcddrivers -lstdc++ -o $(PRGNAME)
install: $(PRGNAME)
- install -d $(BINDIR)
- install -m 755 -o root -g root $(HAVE_STRIP) $(PRGNAME) $(BINDIR)
+ install -d $(DESTDIR)$(BINDIR)
+ install -m 755 $(HAVE_STRIP) $(PRGNAME) $(DESTDIR)$(BINDIR)
uninstall:
- rm -f $(BINDIR)/$(PRGNAME)
+ rm -f $(DESTDIR)$(BINDIR)/$(PRGNAME)
clean:
@-rm -f $(OBJS) $(DEPFILE) $(PRGNAME) *~
-
diff --git a/tools/showtext/Makefile b/tools/showtext/Makefile
index 516f966..20b3381 100644
--- a/tools/showtext/Makefile
+++ b/tools/showtext/Makefile
@@ -2,7 +2,7 @@
# Makefile for the GraphLCD tool showtext
#
--include ../../Make.config
+include ../../Make.config
PRGNAME = showtext
@@ -32,12 +32,11 @@ $(PRGNAME): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -rdynamic $(OBJS) $(LIBS) $(LIBDIRS) -lglcdgraphics -lglcddrivers -lstdc++ -o $(PRGNAME)
install: $(PRGNAME)
- install -d $(BINDIR)
- install -m 755 -o root -g root $(HAVE_STRIP) $(PRGNAME) $(BINDIR)
+ install -d $(DESTDIR)$(BINDIR)
+ install -m 755 $(HAVE_STRIP) $(PRGNAME) $(DESTDIR)$(BINDIR)
uninstall:
- rm -f $(BINDIR)/$(PRGNAME)
+ rm -f $(DESTDIR)$(BINDIR)/$(PRGNAME)
clean:
@-rm -f $(OBJS) $(DEPFILE) $(PRGNAME) *~
-
diff --git a/tools/skintest/Makefile b/tools/skintest/Makefile
index fe73388..0c0f43e 100644
--- a/tools/skintest/Makefile
+++ b/tools/skintest/Makefile
@@ -2,7 +2,7 @@
# Makefile for the GraphLCD tool showtext
#
--include ../../Make.config
+include ../../Make.config
PRGNAME = skintest
@@ -32,11 +32,11 @@ $(PRGNAME): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -rdynamic $(OBJS) $(LIBS) $(LIBDIRS) -lglcdgraphics -lglcddrivers -lglcdskin -lstdc++ -o $(PRGNAME)
install: $(PRGNAME)
- install -d $(BINDIR)
- install -m 755 -o root -g root $(HAVE_STRIP) $(PRGNAME) $(BINDIR)
+ install -d $(DESTDIR)$(BINDIR)
+ install -m 755 $(HAVE_STRIP) $(PRGNAME) $(DESTDIR)$(BINDIR)
uninstall:
- rm -f $(BINDIR)/$(PRGNAME)
+ rm -f $(DESTDIR)$(BINDIR)/$(PRGNAME)
clean:
@-rm -f $(OBJS) $(DEPFILE) $(PRGNAME) *~