diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-03-13 21:41:56 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-03-13 21:42:03 +0100 |
| commit | 15ade3d4f156b70da74f599cd2f16dd818e63c41 (patch) | |
| tree | be1bb8ff2909cd9cfc694c9f11ef2471144e605f | |
| parent | 42636a96271693fc5545da691d624b51b6192b5f (diff) | |
| download | libbootstr-c-15ade3d4f156b70da74f599cd2f16dd818e63c41.tar.gz libbootstr-c-15ade3d4f156b70da74f599cd2f16dd818e63c41.zip | |
Reorganize and fix install target
| -rw-r--r-- | .gitignore | 5 | ||||
| -rw-r--r-- | Makefile | 33 | ||||
| -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
@@ -1,4 +1 @@ -puny -bootstr -*.o -*.so +build @@ -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/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 |
