summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJohny Mattsson <jmattsson@dius.com.au>2017-05-30 17:42:34 +1000
committerJohny Mattsson <jmattsson@dius.com.au>2017-05-30 17:42:34 +1000
commit55e6f6890acddfd8b415db8f92ebb7ea1a2d4166 (patch)
tree611d33fa5302fed2401895639590ad3d8b0fe7c7 /Makefile
parent222ed582c80640ba18b419e8276877bdc4662d75 (diff)
downloadqlprint-55e6f6890acddfd8b415db8f92ebb7ea1a2d4166.tar.gz
qlprint-55e6f6890acddfd8b415db8f92ebb7ea1a2d4166.tar.xz
qlprint-55e6f6890acddfd8b415db8f92ebb7ea1a2d4166.zip
Initial import.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d170eb3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,35 @@
+default: build/qlprint
+
+# Get rid of most of the implicit rules by clearing the .SUFFIXES target
+.SUFFIXES:
+# Get rid of the auto-checkout from old version control systems rules
+%: %,v
+%: RCS/%,v
+%: RCS/%
+%: s.%
+%: SCCS/s.%
+
+
+CFLAGS=-std=c11 -Wall -Wextra -g -Iinclude -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809 $(shell pkg-config --cflags libpng)
+LDFLAGS=$(shell pkg-config --libs libpng)
+
+OBJS=$(addprefix build/, \
+ main.o \
+ ql.o \
+ loadpng.o \
+)
+
+vpath %.c src
+
+build/%.o: %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+build/qlprint: $(OBJS)
+ $(CC) $(LDFLAGS) $^ -o $@
+
+$(OBJS): $(wildcard include/*) Makefile
+
+.PHONY: clean
+clean:
+ -rm -f build/*
+