-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
92 lines (67 loc) · 2.23 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
87
88
89
90
91
92
###########################
## Makefile for Axel ##
## ##
## Copyright 2001 Lintux ##
###########################
### DEFINITIONS
-include Makefile.settings
.SUFFIXES: .po .mo
# Add your translation here..
MOFILES = nl.mo de.mo ru.mo zh_CN.mo
all: $(OUTFILE)
install: install-bin install-etc install-man
uninstall: uninstall-bin uninstall-etc uninstall-man
clean:
rm -f *.o $(OUTFILE) search core *.mo
distclean: clean
rm -f Makefile.settings config.h axel-*.tar axel-*.tar.gz axel-*.tar.bz2
install-man:
mkdir -p $(DESTDIR)$(MANDIR)/man1/
cp axel.1 $(DESTDIR)$(MANDIR)/man1/axel.1
mkdir -p $(DESTDIR)$(MANDIR)/zh_CN/man1/
cp axel_zh_CN.1 $(DESTDIR)$(MANDIR)/zh_CN/man1/axel.1
uninstall-man:
rm -f $(MANDIR)/man1/axel.1
rm -f $(MANDIR)/zh_CN/man1/axel.1
install-etc:
mkdir -p $(DESTDIR)$(ETCDIR)/
cp axelrc.example $(DESTDIR)$(ETCDIR)/axelrc
uninstall-etc:
rm -f $(ETCDIR)/axelrc
### MAIN PROGRAM
$(OUTFILE): axel.o conf.o conn.o ftp.o http.o search.o tcp.o text.o
$(CC) *.o -o $(OUTFILE) $(LFLAGS)
$(STRIP) $(OUTFILE)
.c.o:
$(CC) -c $*.c -o $*.o $(CFLAGS)
install-bin:
mkdir -p $(DESTDIR)$(BINDIR)/
cp $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE)
uninstall-bin:
rm -f $(BINDIR)/$(OUTFILE)
tar:
version=`sed -n 's/#define AXEL_VERSION_STRING[ \t]*"\([^"]*\)"/\1/p' < axel.h` && \
tar --create --numeric-owner --owner 0 --group 0 --transform "s#^#axel-$${version}/#" "--file=axel-$${version}.tar" --exclude-vcs -- *.c *.h *.po *.1 configure Makefile axelrc.example gui API CHANGES COPYING CREDITS README && \
gzip --best < "axel-$${version}.tar" > "axel-$${version}.tar.gz" && \
bzip2 --best < "axel-$${version}.tar" > "axel-$${version}.tar.bz2"
### I18N FILES
%.po:
-@mv $@ [email protected]
xgettext -k_ -o$@ *.[ch]
@if [ -e [email protected] ]; then \
echo -n Merging files...; \
msgmerge -vo [email protected] [email protected] $@; \
rm -f $@ [email protected]; \
mv [email protected] $@; \
fi
.po.mo: [email protected]
msgfmt -vo $@ $*.po
i18n-mofiles: $(MOFILES)
install-i18n:
@echo Installing locale files...
@for i in $(MOFILES); do \
mkdir -p $(DESTDIR)$(LOCALE)/`echo $$i | cut -d. -f1`/LC_MESSAGES/; \
cp $$i $(DESTDIR)$(LOCALE)/`echo $$i | cut -d. -f1`/LC_MESSAGES/axel.mo; \
done
uninstall-i18n:
cd $(LOCALE); find . -name axel.mo -exec 'rm' '{}' ';'