summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--Makefile33
-rw-r--r--include/bootstr.h (renamed from bootstr.h)0
-rw-r--r--src/bootstr.c (renamed from bootstr.c)0
-rw-r--r--src/puny.c (renamed from puny.c)0
-rw-r--r--test/puny-basic.in (renamed from test/basic.in)0
-rw-r--r--test/puny-basic.out (renamed from test/basic.out)0
7 files changed, 19 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
index 3158d4f..378eac2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1 @@
-puny
-bootstr
-*.o
-*.so
+build
diff --git a/Makefile b/Makefile
index a75f410..8aabe31 100644
--- a/Makefile
+++ b/Makefile
@@ -1,31 +1,34 @@
PREFIX ?= /usr/local
-BINDIR ?= /bin
LIBDIR ?= /lib
+INCLDIR ?= /include
-all: libbootstr.so puny
+all: build/libbootstr.so build/puny
clean:
- rm -f puny
+ rm -rf build
-puny: puny.c libbootstr.so
- $(CC) -o $@ $(filter %.c,$^) -g -lunistring -L . -lbootstr
+build:
+ mkdir build
-test/%.phony: test/%.in test/%.out
- @echo "test $*"
- test "$(shell cat test/$*.in | ./puny -e)" = "$(shell cat test/$*.out)"
- test "$(shell cat test/$*.out | ./puny -d)" = "$(shell cat test/$*.in)"
+build/puny: src/puny.c build/libbootstr.so | build
+ $(CC) -o $@ $< -g -I include -L build -lunistring -lbootstr
+
+build/libbootstr.so: src/bootstr.c include/bootstr.h | build
+ $(CC) -o $@ $< -I include -fPIC -shared -lunistring
-test: puny test/basic.phony
+test/%.phony: test/%.in test/%.out
+ @echo "> test $*"
+ test "$(shell cat test/$*.in | ./build/puny -e)" = "$(shell cat test/$*.out)"
+ test "$(shell cat test/$*.out | ./build/puny -d)" = "$(shell cat test/$*.in)"
-libbootstr.so: bootstr.o
- $(CC) -o $@ $^ -fPIC -shared -lunistring
+test: build/puny test/puny-basic.phony
install:
- install -m755 libbootstr.so -t "$(DESTDIR)$(PREFIX)$(LIBDIR)"
- install -m755 puny -t "$(DESTDIR)$(PREFIX)$(BINDIR)"
+ install -m644 include/bootstr.h -t "$(DESTDIR)$(PREFIX)$(INCLDIR)"
+ install -m755 build/libbootstr.so -t "$(DESTDIR)$(PREFIX)$(LIBDIR)"
uninstall:
+ rm -f "$(DESTDIR)$(PREFIX)$(INCLDIR)/bootstr.h"
rm -f "$(DESTDIR)$(PREFIX)$(LIBDIR)/libbootstr.so"
- rm -f "$(DESTDIR)$(PREFIX)$(BINDIR)/puny"
.PHONY: all clean test install uninstall
diff --git a/bootstr.h b/include/bootstr.h
index 8f26a6d..8f26a6d 100644
--- a/bootstr.h
+++ b/include/bootstr.h
diff --git a/bootstr.c b/src/bootstr.c
index 97cf693..97cf693 100644
--- a/bootstr.c
+++ b/src/bootstr.c
diff --git a/puny.c b/src/puny.c
index 0ea9c29..0ea9c29 100644
--- a/puny.c
+++ b/src/puny.c
diff --git a/test/basic.in b/test/puny-basic.in
index 71f4119..71f4119 100644
--- a/test/basic.in
+++ b/test/puny-basic.in
diff --git a/test/basic.out b/test/puny-basic.out
index 7e12b07..7e12b07 100644
--- a/test/basic.out
+++ b/test/puny-basic.out