… | |
… | |
3 | DESTDIR= |
3 | DESTDIR= |
4 | prefix=/usr/local |
4 | prefix=/usr/local |
5 | bindir=$(prefix)/bin |
5 | bindir=$(prefix)/bin |
6 | mandir=$(prefix)/man |
6 | mandir=$(prefix)/man |
7 | man1dir=$(mandir)/man1 |
7 | man1dir=$(mandir)/man1 |
8 | libdir=$(prefix)/lib |
|
|
9 | sharedir=$(prefix)/share |
8 | sharedir=$(prefix)/share |
10 | getoptdir=$(libdir)/getopt |
9 | getoptdir=$(sharedir)/getopt |
11 | localedir=$(sharedir)/locale |
10 | localedir=$(sharedir)/locale |
12 | |
11 | |
13 | # Define this to 0 to use the getopt(3) routines in this package. |
12 | # Define this to 0 to use the getopt(3) routines in this package. |
14 | LIBCGETOPT=1 |
13 | LIBCGETOPT=1 |
15 | |
14 | |
16 | # Define this to 1 if you do not have the gettext routines |
15 | # Define this to 1 if you do not have the gettext routines |
17 | WITHOUT_GETTEXT=0 |
16 | WITHOUT_GETTEXT=0 |
18 | |
17 | |
19 | |
18 | # For creating the archive |
|
|
19 | PACKAGE=getopt |
|
|
20 | VERSION=1.1.5 |
|
|
21 | BASENAME=$(PACKAGE)-$(VERSION) |
|
|
22 | UNLIKELYNAME=a8vwjfd92 |
20 | |
23 | |
21 | SHELL=/bin/sh |
24 | SHELL=/bin/sh |
22 | |
25 | |
23 | CC=gcc |
26 | CC=gcc |
24 | LD=ld |
27 | LD=ld |
25 | RM=rm -f |
28 | RM=rm -f |
26 | INSTALL=install |
29 | INSTALL=install |
27 | MSGFMT=msgfmt |
30 | MSGFMT=msgfmt |
28 | |
31 | |
29 | LANGUAGES = cs de es fr it ja nl pt_BR |
32 | LANGUAGES = ca cs da de es et eu fi fr gl hu id it ja nl pl pt_BR ru sl sv tr uk vi zh_CN zh_TW |
30 | MOFILES:=$(patsubst %,po/%.mo,$(LANGUAGES)) |
33 | MOFILES:=$(patsubst %,po/%.mo,$(LANGUAGES)) |
31 | |
34 | |
32 | CPPFLAGS=-DLIBCGETOPT=$(LIBCGETOPT) -DWITH_GETTEXT=$(WITH_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX |
35 | CPPFLAGS=-DLIBCGETOPT=$(LIBCGETOPT) -DWITHOUT_GETTEXT=$(WITHOUT_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX -Dprogram_invocation_short_name=\"$(PACKAGE)\" -Dprogram_version=\"$(VERSION)\" |
33 | ifeq ($(LIBCGETOPT),0) |
36 | ifeq ($(LIBCGETOPT),0) |
34 | CPPFLAGS+=-I./gnu |
37 | CPPFLAGS+=-I./gnu |
35 | endif |
38 | endif |
36 | WARNINGS=-Wall \ |
39 | WARNINGS=-Wall \ |
37 | -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual \ |
40 | -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual \ |
… | |
… | |
69 | $(INSTALL) -m 755 -d $(DESTDIR)$(getoptdir) |
72 | $(INSTALL) -m 755 -d $(DESTDIR)$(getoptdir) |
70 | $(INSTALL) -m 755 getopt-parse.bash getopt-parse.tcsh \ |
73 | $(INSTALL) -m 755 getopt-parse.bash getopt-parse.tcsh \ |
71 | getopt-test.bash getopt-test.tcsh \ |
74 | getopt-test.bash getopt-test.tcsh \ |
72 | $(DESTDIR)$(getoptdir) |
75 | $(DESTDIR)$(getoptdir) |
73 | |
76 | |
74 | ifeq ($(WITH_GETTEXT),1) |
77 | ifeq ($(WITHOUT_GETTEXT),0) |
75 | all_po: $(MOFILES) |
78 | all_po: $(MOFILES) |
76 | install_po: all_po |
79 | install_po: all_po |
77 | $(INSTALL) -m 755 -d $(DESTDIR)$(localedir) |
80 | $(INSTALL) -m 755 -d $(DESTDIR)$(localedir) |
78 | for lang in $(LANGUAGES) ; do \ |
81 | for lang in $(LANGUAGES) ; do \ |
79 | dir=$(localedir)/$$lang/LC_MESSAGES; \ |
82 | dir=$(localedir)/$$lang/LC_MESSAGES; \ |
… | |
… | |
91 | %.o: %.c |
94 | %.o: %.c |
92 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c -o $*.o |
95 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c -o $*.o |
93 | |
96 | |
94 | %.mo: %.po |
97 | %.mo: %.po |
95 | $(MSGFMT) -o $@ $< |
98 | $(MSGFMT) -o $@ $< |
|
|
99 | |
|
|
100 | # You need GNU tar for this to work! |
|
|
101 | .PHONY: package |
|
|
102 | package: clean |
|
|
103 | $(RM) -r $(UNLIKELYNAME) |
|
|
104 | mkdir $(UNLIKELYNAME) |
|
|
105 | ln -s .. $(UNLIKELYNAME)/$(BASENAME) |
|
|
106 | cd $(UNLIKELYNAME) && tar cfvzp ../$(BASENAME).tar.gz --exclude='CVS' --exclude='*.tar.gz' --exclude=$(UNLIKELYNAME) $(BASENAME)/* |
|
|
107 | $(RM) -r $(UNLIKELYNAME) |