summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorkaa <kaa@disroot.org>2023-11-09 22:57:12 -0800
committerkaa <kaa@disroot.org>2023-11-09 22:57:12 -0800
commit3ff2e62722ff5a51a32961d97dc028c56e00481f (patch)
tree4a5ccc63c4780be400ef024c7e973365bf51352e /makefile
parent8987d13d3c1a62d2d1db6ecabb29bc76f3529a44 (diff)
A good copy of libhyphen is included in-tree. Makefile has been modified so as to allow easy compilation. The build path is now a compiled-in constant, allowing for the hyphenation patterns in-tree to be referenced from any directory. Hyphenation language may be specified at runtime using -l.
Diffstat (limited to 'makefile')
-rw-r--r--makefile32
1 files changed, 15 insertions, 17 deletions
diff --git a/makefile b/makefile
index 84b0f21..f0c8c7d 100644
--- a/makefile
+++ b/makefile
@@ -1,25 +1,23 @@
CC = cc
#CC = tcc
-CFLAGS = -Wall -I/usr/local/include
-CFLAGS += -std=c89
-LDFLAGS = -L/usr/local/lib -lhyphen
-LDFLAGS += -static
-bindir = /home/kaa/bin
+CFLAGS = -Wall -I/usr/include
+CFLAGS += -static -std=c89 -Iinclude
+LDFLAGS =
+DEST=$$(pwd)/bin
all: hyp
-hyp:
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ en.c hyp.c
-hyp-es:
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ es.c hyp.c
+ext/hyphen-2.8.8/README:
+ cd ext && tar zxf hyphen-2.8.8.tar.gz
+lib/libhyphen.a: ext/hyphen-2.8.8/README
+ cd ext/hyphen-2.8.8 && ./configure --prefix=$$(pwd)/../.. && make install
-clean:
- rm -f hyp hyp-es
+hyp: lib/libhyphen.a
+ $(CC) $(CFLAGS) $(HYPFLAGS) $(LDFLAGS) -o $@ -DBUILD_PATH=\"$$(pwd)\" hyp.c lib/libhyphen.a
+clean:
+ rm -f hyp hyp-es && rm -rf lib include bin && cd ext/hyphen-2.8.8 && make clean
install: all
- cp hyp $(bindir)/hyp
- cp unhyp $(bindir)/unhyp
-
-uninstall:
- rm -f $(bindir)/hyp
- rm -f $(bindir)/unhyp
+ strip hyp
+ cp hyp $(DEST)/hyp
+ cp unhyp $(DEST)/unhyp