summary refs log tree commit diff
path: root/port/wcwidth/Makefile
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-21 16:33:08 -0500
committerJune McEnroe <june@causal.agency>2020-12-21 16:33:08 -0500
commit6528ea0dab2f1e49d2af2140ad82ddd0e047379b (patch)
treebfecbeed199ab19852d4f6847fb4af7afd4dd23b /port/wcwidth/Makefile
parentUpdate PDF URLs (diff)
downloadsrc-6528ea0dab2f1e49d2af2140ad82ddd0e047379b.tar.gz
src-6528ea0dab2f1e49d2af2140ad82ddd0e047379b.zip
Move wcfix to port/wcwidth
Diffstat (limited to 'port/wcwidth/Makefile')
-rw-r--r--port/wcwidth/Makefile24
1 files changed, 16 insertions, 8 deletions
diff --git a/port/wcwidth/Makefile b/port/wcwidth/Makefile
index f6932d6d..50faa653 100644
--- a/port/wcwidth/Makefile
+++ b/port/wcwidth/Makefile
@@ -1,19 +1,27 @@
-PREFIX = ~/.local
+PREFIX ?= ~/.local
 
 OBJS = wcwidth.o wcswidth.o
-DYLIB = libwcwidth.dylib
 
-${DYLIB}: ${OBJS}
+all: libwcwidth.dylib wcfix
+
+libwcwidth.dylib: ${OBJS}
 	${CC} -dynamiclib ${LDFLAGS} ${OBJS} -o $@
 
 wcwidth.o: nonspacing.h wide.h
 
+.SUFFIXES: .in
+
+.in:
+	sed 's|%%PREFIX%%|${PREFIX}|g' $< > $@
+	chmod a+x $@
+
 clean:
-	rm -f ${DYLIB} ${OBJS}
+	rm -f libwcwidth.dylib wcfix ${OBJS}
 
-install: ${DYLIB}
-	install -d ${PREFIX}/lib
-	install -m 644 ${DYLIB} ${PREFIX}/lib
+install: libwcwidth.dylib wcfix
+	install -d ${PREFIX}/lib ${PREFIX}/bin
+	install -m 644 libwcwidth.dylib ${PREFIX}/lib
+	install wcfix ${PREFIX}/bin
 
 uninstall:
-	rm -f ${PREFIX}/lib/${DYLIB}
+	rm -f ${PREFIX}/lib/libwcwidth.dylib ${PREFIX}/bin/wcfix