-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
109 lines (85 loc) · 2.76 KB
/
Makefile.in
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
RUBY = @RUBY@
RD2 = rd2
RD2HTML = $(RD2) $(RD2OPT) $(RD2HTMLOPT)
HTML2TXT = w3m -I e -dump -T text/html
RD2TXT = ($(RD2HTML) | $(HTML2TXT))
SKKSERV = skkserv.rb
VERSION = @VERSION@
CONFFILE = rskkserv.conf
DESTDIR =
prefix = @prefix@
exec_prefix = @exec_prefix@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
datarootdir = @datarootdir@
piddir = @piddir@
logdir = @logdir@
loglevel = @loglevel@
dicfile = @dicfile@
cachedir= @cachedir@
rubylibdir = @rubylibdir@
rubyarchdir = @rubyarchdir@
INSTALL = @INSTALL@
all: $(SKKSERV) $(CONFFILE) ext/Makefile # README INSTALL
cd ext; make $@; cd ..
$(SKKSERV): $(SKKSERV).in @CONFIG_STATUS@
$(RUBY) -p -e 'sub %r%@RUBY\@%, %q%$(RUBY)%' \
-e 'sub %r%@VERSION\@%, %q%$(VERSION)%' \
-e 'sub %r%@sysconfdir\@%, %q%$(sysconfdir)%' $< > $@
chmod 755 $@
$(CONFFILE): $(CONFFILE).in @CONFIG_STATUS@
$(RUBY) -p -e 'sub %r%@loglevel\@%, %q%$(loglevel)%' \
-e 'sub %r%@logdir\@%, %q%$(logdir)%' \
-e 'sub %r%@piddir\@%, %q%$(piddir)%' \
-e 'sub %r%@dicfile\@%, %q%$(dicfile)%' \
-e 'sub %r%@cachedir\@%, %q%$(cachedir)%' $< > $@
INSTALL: doc/INSTALL.rd
$(RD2TXT) <$< >$@
README: doc/README.rd
$(RD2TXT) <$< >$@
ext/extconf.rb: ext/extconf.rb.in @CONFIG_STATUS@
$(RUBY) -p -e 'gsub %r%@prefix\@%, %q%$(prefix)%' \
-e 'gsub %r%@rubylibdir\@%, %q%$(rubylibdir)%' \
-e 'gsub %r%@rubyarchdir\@%, %q%$(rubyarchdir)%' \
$< > $@
ext/Makefile: ext/extconf.rb
cd ext; $(RUBY) extconf.rb
distclean: clean
cd ext; make $@; cd ..
rm -f ext/extconf.rb ext/depend
rm -f config.* configure Makefile README INSTALL rskkserv.spec
rm -rf autom4te.cache
rm -rf skkserv test/conf test/var
clean:
find ./ -name "*~" -exec rm {} \;
cd ext; make $@; cd ..
rm -f $(SKKSERV) $(CONFFILE)
install: all installdirs
cd ext; make DESTDIR=$(DESTDIR) install; cd ..
$(INSTALL) -m0755 $(SKKSERV) $(DESTDIR)$(sbindir)/$(SKKSERV)
if [ ! -f $(DESTDIR)$(sysconfdir)/$(CONFFILE) ]; then \
$(INSTALL) -m0644 $(CONFFILE) $(DESTDIR)$(sysconfdir)/; \
fi
installdirs:
mkdir -p $(DESTDIR)$(sbindir)
mkdir -p $(DESTDIR)$(sysconfdir)
mkdir -p $(DESTDIR)$(cachedir)
uninstall:
rm -f $(DESTDIR)$(sbindir)/$(SKKSERV)
rm -rf $(DESTDIR)$(sysconfdir)
rm -rf $(DESTDIR)$(cachedir)
TEST_RUBY = $(RUBY) -I.
TEST_RUBY_OPTIONS = -Ke
test: $(SKKSERV) $(CONFFILE)
@[ -e skkserv ] || ln -s ext/lib skkserv
@[ -e test ] || mkdir test
@[ -e test/conf ] || mkdir test/conf
@[ -e test/var ] || mkdir test/var
$(TEST_RUBY) $(TEST_RUBY_OPTIONS) test/skkdic.rb
$(TEST_RUBY) $(TEST_RUBY_OPTIONS) test/ebdic.rb
$(TEST_RUBY) $(TEST_RUBY_OPTIONS) test/cdbdic.rb
@$(TEST_RUBY) skkserv.rb --config test/rskkserv.conf &
@sleep 1
$(TEST_RUBY) $(TEST_RUBY_OPTIONS) test/skkserv.rb
@kill `cat test/var/rskkserv.pid`
.PHONY: clean install installdirs uninstall test