aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-12-01 02:53:50 +0100
committerMattias Andrée <maandree@kth.se>2016-12-01 02:53:50 +0100
commitc7f8e2a4d41614d71960bb42114a1cc61c3ab85a (patch)
tree56d663ae26d1cb9f79bc57aba3a184b454025ecb
parentFix ICC parser (diff)
downloadcg-tools-c7f8e2a4d41614d71960bb42114a1cc61c3ab85a.tar.gz
cg-tools-c7f8e2a4d41614d71960bb42114a1cc61c3ab85a.tar.bz2
cg-tools-c7f8e2a4d41614d71960bb42114a1cc61c3ab85a.tar.xz
Add makefile
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c86038f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+PKGNAME = cg-tools
+
+
+BIN = bin/cg-brilliance \
+ bin/cg-darkroom \
+ bin/cg-gamma \
+ bin/cg-icc \
+ bin/cg-limits \
+ bin/cg-negative \
+ bin/cg-query \
+ bin/cg-rainbow \
+ bin/cg-remove \
+ bin/cg-sleepmode
+
+OPTIMISE = -O2
+
+WARN = -Wall -Wextra
+
+DEF = -D'PKGNAME="$(PKGNAME)"' -D_DEFAULT_SOURCE
+
+
+all: $(BIN)
+
+bin/%: obj/%.o obj/cg-base.o
+ @mkdir -p -- "$$(dirname -- "$@")"
+ $(CC) -std=c99 $(OPTIMISE) $(WARN) $(DEF) -o $@ $^ $(LDFLAGS) -lm -lcoopgamma
+
+bin/cg-query: obj/cg-query.o
+ @mkdir -p -- "$$(dirname -- "$@")"
+ $(CC) -std=c99 $(OPTIMISE) $(WARN) $(DEF) -o $@ $^ $(LDFLAGS) -lm -lcoopgamma
+
+bin/cg-remove: obj/cg-remove.o
+ @mkdir -p -- "$$(dirname -- "$@")"
+ $(CC) -std=c99 $(OPTIMISE) $(WARN) $(DEF) -o $@ $^ $(LDFLAGS) -lm -lcoopgamma
+
+obj/%.o: src/%.c src/*.h
+ @mkdir -p -- "$$(dirname -- "$@")"
+ $(CC) -std=c99 $(OPTIMISE) $(WARN) $(DEF) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+clean:
+ -rm -r -- bin obj
+
+.PHONY: all clean