-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
86 lines (74 loc) · 1.76 KB
/
Makefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Configuration
#CC = gcc
LD = $(CC)
CFLAGS = -IModules -Wall -pedantic
LDFLAGS = -lm # only actually needed by accci and wordaccci
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
LIB = \
Modules/accrpt.o \
Modules/charclass.o \
Modules/ci.o \
Modules/dist.o \
Modules/edorpt.o \
Modules/list.o \
Modules/sort.o \
Modules/stopword.o \
Modules/sync.o \
Modules/table.o \
Modules/text.o \
Modules/unicode.o \
Modules/util.o \
Modules/wacrpt.o \
Modules/word.o
SRC = \
accci/accci.c \
accdist/accdist.c \
accsum/accsum.c \
accuracy/accuracy.c \
asc2uni/asc2uni.c \
editop/editop.c \
editopcost/editopcost.c \
editopsum/editopsum.c \
groupacc/groupacc.c \
ngram/ngram.c \
nonstopacc/nonstopacc.c \
synctext/synctext.c \
uni2asc/uni2asc.c \
vote/vote.c \
wordacc/wordacc.c \
wordaccci/wordaccci.c \
wordaccdist/wordaccdist.c \
wordaccsum/wordaccsum.c \
wordfreq/wordfreq.c
EXTRAS = ocrevalutf8 tessaccsummary
HDR = $(LIB:.o=.h)
OBJ = $(SRC:.c=.o) $(LIB)
BIN = $(SRC:.c=)
MAN = $(SRC:.c=.1)
all: $(BIN)
$(OBJ): $(HDR)
$(BIN): util.a
.o:
echo LD $@
$(LD) -o $@ $< util.a $(LDFLAGS)
.c.o:
echo CC $<
$(CC) -c -o $@ $< $(CFLAGS)
util.a: $(LIB) $(HDR)
echo AR $@
$(AR) -r -s -c $@ $(LIB)
install: all
echo Installing binaries to $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(PREFIX)/bin
for f in $(BIN); do b=`basename "$$f"`; cp -f "$$f" "$(DESTDIR)$(PREFIX)/bin/$$b"; done
cp -f $(EXTRAS) "$(DESTDIR)$(PREFIX)/bin"
cd "$(DESTDIR)$(PREFIX)/bin" && chmod 755 $(EXTRAS)
echo Installing manual pages to $(DESTDIR)$(MANPREFIX)/man1
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
for f in $(MAN); do b=`basename "$$f"`; cp -f "$$f" "$(DESTDIR)$(MANPREFIX)/man1/$$b"; done
clean:
echo Cleaning
rm -f $(BIN) $(OBJ) $(LIB) util.a
.PHONY: all install clean
.SILENT: