summaryrefslogtreecommitdiff
path: root/makefile
blob: b0d2bb1b86df1282020c1cfb1f7e8808df8c0145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
CC = cc
#CC = tcc
CFLAGS = -Wall -I/usr/include
CFLAGS += -static -std=c89 -Iinclude
LDFLAGS =
DEST=$$(pwd)/bin

all: hyp

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

hyp: lib/libhyphen.a
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ -DBUILD_PATH=\"$$(pwd)\" hyp.c lib/libhyphen.a
win/hyp.exe:
	cd win && \
		gcc -fdiagnostics-color=never -I. -static -o hyp.exe -DBUILD_PATH=\"$$(pwd)\" ../hyp.c libhyphen.a && \
		strip hyp.exe

clean:
	rm -f hyp win/hyp.exe && rm -rf lib include bin share && cd ext/hyphen-2.8.8 && make clean
dist: clean
	rm -rf ext/hyphen-2.8.8
install: all
	strip hyp
	cp hyp $(DEST)/hyp
	cp unhyp $(DEST)/unhyp