summaryrefslogtreecommitdiff
path: root/glcdgraphics/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'glcdgraphics/Makefile')
-rw-r--r--glcdgraphics/Makefile41
1 files changed, 32 insertions, 9 deletions
diff --git a/glcdgraphics/Makefile b/glcdgraphics/Makefile
index 7f7ff74..2d6e7ff 100644
--- a/glcdgraphics/Makefile
+++ b/glcdgraphics/Makefile
@@ -4,31 +4,39 @@
-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 =
+ifdef HAVE_GRAPHICSMAGICK
+ IMAGELIB = graphicsmagick
+endif
+ifdef HAVE_IMAGEMAGICK
+ IMAGELIB = imagemagick
+endif
+
+
CXXFLAGS += -fPIC
VERMAJOR = 2
-VERMINOR = 0
+VERMINOR = 1
VERMICRO = 0
BASENAME = libglcdgraphics.so
LIBNAME = $(BASENAME).$(VERMAJOR).$(VERMINOR).$(VERMICRO)
-OBJS = bitmap.o common.o font.o glcd.o image.o imagefile.o pbm.o
+OBJS = bitmap.o common.o font.o glcd.o image.o imagefile.o pbm.o extformats.o
-HEADERS = bitmap.h font.h glcd.h image.h imagefile.h pbm.h
+HEADERS = bitmap.h font.h glcd.h image.h imagefile.h pbm.h extformats.h
### Implicit rules:
%.o: %.c
- $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
+ $(CXX) $(CXXEXTRA) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
# Dependencies:
-MAKEDEP = g++ -MM -MG
-DEPFILE = .dependencies
-$(DEPFILE): Makefile
- @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+DEPFILE = $(OBJS:%.o=%.d)
-include $(DEPFILE)
@@ -41,7 +49,22 @@ ifdef HAVE_FREETYPE2
LIBS += -lfreetype
endif
DEFINES += -DHAVE_FREETYPE2
-endif### Targets:
+endif
+
+# two ifdef/endif are used because older installations may not support 'else ifdef'
+ifeq ($(IMAGELIB), imagemagick)
+ DEFINES += -DHAVE_IMAGEMAGICK
+ INCLUDES += $(shell pkg-config --cflags ImageMagick++)
+ LIBS += $(shell pkg-config --libs ImageMagick++)
+endif
+ifeq ($(IMAGELIB), graphicsmagick)
+ DEFINES += -DHAVE_IMAGEMAGICK # yep, really HAVE_IMAGEMAGICK here
+ INCLUDES += $(shell pkg-config --cflags GraphicsMagick++)
+ LIBS += $(shell pkg-config --libs GraphicsMagick++)
+endif
+
+
+### Targets:
all: $(LIBNAME)