aboutsummaryrefslogtreecommitdiffstats
path: root/japanese/nkf/files/patch-Makefile
blob: 79e9e20fb514a2476d23537f8b245616310b3a20 (plain) (blame)
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
--- Makefile.orig   2009-11-17 09:33:04.000000000 +0900
+++ Makefile    2010-02-15 23:02:44.471546444 +0900
@@ -1,18 +1,22 @@
-CC = cc
-CFLAGS = -g -O2 -Wall -pedantic
+CC?= cc
+CFLAGS?= -g -O2 -Wall -pedantic
 # CFLAGS = -O3
 SHAR = shar 
 # SHAR = shar -T
-PERL = perl
-RM = rm -rf
+PERL?= perl
+RM?= rm -rf
 VERSION = 2.1.2
 MKDIR = mkdir
-prefix = /usr/local
+PREFIX?= /usr/local
+INSTALL?= /usr/bin/install
+BSD_INSTALL_PROGRAM?= ${INSTALL} -s -o root -g wheel -m 555
+BSD_INSTALL_MAN?= ${INSTALL}    -o root -g wheel -m 444
 
 .PHONY: clean install test tar shar
 
 nkf : nkf.o utf8tbl.o
    $(CC) $(CFLAGS) -o nkf nkf.o utf8tbl.o
+   ./nkf -e nkf.1j > nkf.1j.euc
 
 nkf.o : nkf.c nkf.h utf8tbl.h config.h
    $(CC) $(CFLAGS) -c nkf.c
@@ -34,14 +38,14 @@
    make test )
 
 install:
-   -$(MKDIR) $(prefix)/bin
-   -$(MKDIR) $(prefix)/man
-   -$(MKDIR) $(prefix)/man/man1
-   -$(MKDIR) $(prefix)/man/ja
-   -$(MKDIR) $(prefix)/man/ja/man1
-   cp -f nkf $(prefix)/bin/
-   cp -f nkf.1 $(prefix)/man/man1/
-   cp -f nkf.1j $(prefix)/man/ja/man1/nkf.1
+   -$(MKDIR) -p $(PREFIX)/bin
+   -$(MKDIR) -p $(PREFIX)/man
+   -$(MKDIR) -p $(PREFIX)/man/man1
+   -$(MKDIR) -p $(PREFIX)/man/ja
+   -$(MKDIR) -p $(PREFIX)/man/ja/man1
+   ${BSD_INSTALL_PROGRAM} nkf ${PREFIX}/bin/
+   ${BSD_INSTALL_MAN} nkf.1 ${PREFIX}/man/man1/
+   ${BSD_INSTALL_MAN} nkf.1j.euc ${PREFIX}/man/ja/man1/nkf.1
 
 shar:
    -mkdir nkf-$(VERSION)