summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..86707ce
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+# path definitions
+INSTALLPREFIX = /usr
+INSTALL=/usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+
+# compiler options
+CC = gcc
+CPP = g++
+CFLAGS = -I. -I/usr/include -Wall -fPIC -g \
+ -D__DEBUG__ -D__DEBUG_ALL__x
+
+OBJECTS=gallery-utils.o jpeg-utils.o xml-parser.o setup.o items.o generators.o cgg.o
+
+.SUFFIXES: .c .cpp
+.c.o:
+ $(CC) $(CFLAGS) `pkg-config libxml-2.0 glib-2.0 libexif --cflags` `Wand-config --cflags` -c $<
+.cpp.o:
+ $(CC) $(CFLAGS) `pkg-config libxml-2.0 glib-2.0 libexif --cflags` `Wand-config --cppflags` -c $<
+
+all cgg: check $(OBJECTS)
+ $(CC) -o cgg $(OBJECTS) -lm $(CFLAGS) `pkg-config libxml-2.0 glib-2.0 libexif --libs` `Wand-config --ldflags --libs`
+
+cgg.o: cgg.c
+jpeg-utils.o: jpeg-utils.c jpeg-utils.h
+gallery-utils.o: gallery-utils.c gallery-utils.h
+setup.o: setup.c setup.h
+xml-parser.o: xml-parser.c xml-parser.h
+items.o: items.c items.h
+generators.o: generators.c generators.h
+
+check::
+ @pkg-config --cflags libxml-2.0 glib-2.0 libexif > /dev/null || exit 1
+ @Wand-config --cflags > /dev/null || exit 1
+
+install::
+ $(INSTALL) ./cgg $(INSTALLPREFIX)/bin
+
+clean:
+ rm -f *.o *.d cgg
+