/[axel]/branches/3.x-broken/Makefile
ViewVC logotype

Contents of /branches/3.x-broken/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 113 - (hide annotations) (download)
Sun May 10 21:19:15 2009 UTC (4 years ago) by phihag-guest
File size: 3312 byte(s)
Remove user name from tarball
1 appaji-guest 2
2     ### DEFINITIONS
3    
4    
5 phihag-guest 61 CFGDIR=cfg/
6     CLIDIR=cli/
7     DOCDIR=doc/
8     I18NDIR=i18n/
9     OUTDIR=out/
10     SRCDIR=src/
11     TESTDIR=test/
12    
13     include ${CFGDIR}Makefile.settings
14    
15 appaji-guest 2 .SUFFIXES: .po .mo
16    
17     # Add your translation here..
18 appaji-guest 30 MOFILES = nl.mo de.mo ru.mo
19 appaji-guest 2
20    
21 phihag-guest 61
22     all: main test tar
23    
24     fast: main
25    
26     prepare:
27 phihag-guest 113 mkdir -p -- "${OUTDIR}"
28 phihag-guest 61
29     clean:
30 phihag-guest 113 rm -rf -- "${OUTDIR}"
31 phihag-guest 61
32     distclean: clean
33 phihag-guest 113 rm -rf -- "${CFGDIR}"
34 phihag-guest 61
35     tar: main prepare
36     version=$$(sed -n 's/#define AXEL_VERSION_STRING[ \t]*"\([^"]*\)"/\1/p' < axel.h) && \
37 phihag-guest 113 tar --create --numeric-owner --owner 0 --group 0 --transform "s#^#axel-$${version}/#" "--file=${OUTDIR}axel-$${version}.tar" --exclude-vcs -- "${SRCDIR}" "${TESTDIR}" "${I18NDIR}" "${DOCDIR}" configure Makefile axelrc.example axel.spec && \
38 phihag-guest 61 gzip --best < "${OUTDIR}axel-$${version}.tar" > "${OUTDIR}axel-$${version}.tar.gz" && \
39     bzip2 --best < "${OUTDIR}axel-$${version}.tar" > "${OUTDIR}axel-$${version}.tar.bz2"
40    
41    
42     ### MAIN PROGRAM
43    
44     main: prepare compile link-cli
45    
46     compile: compile-shared compile-cli
47    
48     compile-shared: prepare
49     mkdir -p "${OUTDIR}bin/"
50     for file in ${SRCDIR}*.c; do \
51     fo=$$(echo $${file} | sed -n 's;.*/\(.*\)\.c;\1\.o;p') ; \
52     $(CC) -c "$${file}" -o "${OUTDIR}bin/$${fo}" $(CFLAGS) || exit $$? ; \
53     done
54    
55     compile-cli: prepare
56     for file in ${CLIDIR}*.c; do \
57     fo=$$(echo $${file} | sed -n 's;.*/\(.*\)\.c;\1\.o;p') ; \
58     $(CC) -c "$${file}" -o "${OUTDIR}cli/$${fo}" $(CFLAGS) || exit $$? ; \
59     done
60    
61     link-cli: compile-cli
62     $(CC) ${OUTDIR}bin/*.o ${OUTDIR}cli/*.o -o "${$OUTDIR}$(OUTFILE)" $(LFLAGS)
63     ifdef STRIP
64     $(STRIP) "${OUTDIR}$(OUTFILE)"
65     endif
66    
67     ### Testing
68    
69     test: test-compile
70     "${OUTDIR}test/test-axel"
71    
72     test-compile: prepare compile-shared
73     mkdir -p "${OUTDIR}test"
74     for file in ${TESTDIR}*.c; do \
75     fo=$$(echo $${file} | sed -n 's;.*/\(.*\)\.c;\1\.o;p') ; \
76     $(CC) -c "$${file}" -o "${OUTDIR}test/$${fo}" $(CFLAGS) $(CFLAGS_TEST) || exit $$? ; \
77     done
78     $(CC) ${OUTDIR}test/*.o ${OUTDIR}bin/*.o -o "${OUTDIR}test/test-axel" $(LFLAGS) $(LFLAGS_TEST)
79    
80    
81     ### Install / Uninstall
82    
83 appaji-guest 2 install: install-bin install-etc install-man
84     uninstall: uninstall-bin uninstall-etc uninstall-man
85    
86     ifdef I18N
87     all: $(MOFILES)
88     install: install-i18n
89     uninstall: uninstall-i18n
90     endif
91    
92     install-man:
93     mkdir -p $(DESTDIR)$(MANDIR)/man1/
94 phihag-guest 61 cp "${DOCDIR}axel.1" $(DESTDIR)$(MANDIR)/man1/axel.1
95 appaji-guest 2
96     uninstall-man:
97     rm -f $(MANDIR)/man1/axel.1
98    
99     install-etc:
100     mkdir -p $(DESTDIR)$(ETCDIR)/
101     cp axelrc.example $(DESTDIR)$(ETCDIR)/axelrc
102    
103     uninstall-etc:
104     rm -f $(ETCDIR)/axelrc
105    
106     install-bin:
107     mkdir -p $(DESTDIR)$(BINDIR)/
108 phihag-guest 61 cp "${OUTDIR}$(OUTFILE)" $(DESTDIR)$(BINDIR)/$(OUTFILE)
109 appaji-guest 2
110     uninstall-bin:
111     rm -f $(BINDIR)/$(OUTFILE)
112    
113    
114     ### I18N FILES
115    
116     %.po:
117 phihag-guest 61 -@mv ${I18NDIR}$@ ${I18NDIR}$@.bak
118     xgettext -k_ -o${I18NDIR}$@ ${I18NDIR}*.[ch]
119     @if [ -e ${I18NDIR}$@.bak ]; then \
120 appaji-guest 2 echo -n Merging files...; \
121 phihag-guest 61 msgmerge -vo ${I18NDIR}$@.combo ${I18NDIR}$@.bak $@; \
122     rm -f ${I18NDIR}$@ ${I18NDIR}$@.bak; \
123     mv ${I18NDIR}$@.combo ${I18NDIR}$@; \
124 appaji-guest 2 fi
125    
126     .po.mo: $@.po
127 phihag-guest 61 msgfmt -vo ${OUTDIR}i18n/$@ ${I18NDIR}$*.po
128 appaji-guest 2
129     install-i18n:
130     @echo Installing locale files...
131 phihag-guest 61 @for mofile in $(MOFILES); do \
132     localename=$$(echo de.$$i | cut -d. -f1)
133     mkdir -p $(DESTDIR)$(LOCALE)/$${localename}/LC_MESSAGES/; \
134     cp ${I18NDIR}$${mofile} $(DESTDIR)$(LOCALE)/$${localename}/LC_MESSAGES/axel.mo; \
135 appaji-guest 2 done
136    
137     uninstall-i18n:
138     cd $(LOCALE); find . -name axel.mo -exec 'rm' '{}' ';'

  ViewVC Help
Powered by ViewVC 1.1.5