summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2017-03-30 17:31:44 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2017-04-13 14:49:46 +0300
commit76b8c9e03c97b16d9ff97f3b79c0ecbff0f5e7f2 (patch)
tree70f1d22a923d1c01b22b2fade3b6e96365990dda /Makefile
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0a8aaf8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+PREFIX ?= /usr/local
+bindir ?= /bin
+
+WARNINGS := -Wall -Wextra -Wformat=2 -Winit-self -Wfloat-equal -Wcast-align -Wpointer-arith
+CFLAGS += -std=c11 $(WARNINGS)
+
+all: fspec-dump dec2bin xidec xi2path xils xifile
+
+%.c: %.rl
+ ragel $^
+
+fspec-dump: src/ragel/ragel.h src/ragel/fspec.h src/ragel/fspec.c src/dump.c
+ $(LINK.c) $(filter %.c,$^) $(LDLIBS) -o $@
+
+dec2bin: src/utils/dec2bin.c
+ $(LINK.c) $(filter %.c,$^) $(LDLIBS) -o $@
+
+xidec: src/xi/xidec.c
+ $(LINK.c) $(filter %.c,$^) $(LDLIBS) -o $@
+
+xi2path: src/xi/xi2path.c
+ $(LINK.c) $(filter %.c,$^) $(LDLIBS) -o $@
+
+xils: src/xi/xils.c
+ $(LINK.c) $(filter %.c,$^) $(LDLIBS) -o $@
+
+xifile: src/xi/xifile.c
+ $(LINK.c) $(filter %.c,$^) $(LDLIBS) -o $@
+
+install:
+ install -Dm755 $(DESTDIR)$(PREFIX)$(bindir)/fspec-dump
+ install -Dm755 $(DESTDIR)$(PREFIX)$(bindir)/dec2bin
+ install -Dm755 $(DESTDIR)$(PREFIX)$(bindir)/xidec
+ install -Dm755 $(DESTDIR)$(PREFIX)$(bindir)/xi2path
+ install -Dm755 $(DESTDIR)$(PREFIX)$(bindir)/xils
+ install -Dm755 $(DESTDIR)$(PREFIX)$(bindir)/xifile
+
+clean:
+ $(RM) src/ragel/fspec.c
+ $(RM) fspec-dump dec2bin xidec xi2path xils xifile
+
+.PHONY: all clean install