Added partial support for building with OBJDIR

This commit is contained in:
Pierre Pronchery 2014-11-04 00:58:49 +01:00
parent 945b9963c4
commit 34aa79ef13
11 changed files with 141 additions and 85 deletions

View File

@ -3,7 +3,8 @@ VERSION = 0.2.6
SUBDIRS = data doc po src tools SUBDIRS = data doc po src tools
RM = rm -f RM = rm -f
LN = ln -f LN = ln -f
TAR = tar -czvf TAR = tar
MKDIR = mkdir -m 0755 -p
all: subdirs all: subdirs
@ -20,7 +21,7 @@ distclean:
dist: dist:
$(RM) -r -- $(PACKAGE)-$(VERSION) $(RM) -r -- $(PACKAGE)-$(VERSION)
$(LN) -s -- . $(PACKAGE)-$(VERSION) $(LN) -s -- . $(PACKAGE)-$(VERSION)
@$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \ @$(TAR) -czvf $(PACKAGE)-$(VERSION).tar.gz -- \
$(PACKAGE)-$(VERSION)/data/Makefile \ $(PACKAGE)-$(VERSION)/data/Makefile \
$(PACKAGE)-$(VERSION)/data/deforaos-helper.desktop \ $(PACKAGE)-$(VERSION)/data/deforaos-helper.desktop \
$(PACKAGE)-$(VERSION)/data/deforaos-surfer.desktop \ $(PACKAGE)-$(VERSION)/data/deforaos-surfer.desktop \
@ -81,10 +82,21 @@ dist:
$(PACKAGE)-$(VERSION)/project.conf $(PACKAGE)-$(VERSION)/project.conf
$(RM) -- $(PACKAGE)-$(VERSION) $(RM) -- $(PACKAGE)-$(VERSION)
distcheck: dist
$(TAR) -xzvf $(PACKAGE)-$(VERSION).tar.gz
$(MKDIR) -- $(PACKAGE)-$(VERSION)/objdir
$(MKDIR) -- $(PACKAGE)-$(VERSION)/destdir
(cd "$(PACKAGE)-$(VERSION)" && $(MAKE) OBJDIR="$$PWD/objdir/")
(cd "$(PACKAGE)-$(VERSION)" && $(MAKE) OBJDIR="$$PWD/objdir/" DESTDIR="$$PWD/destdir" install)
(cd "$(PACKAGE)-$(VERSION)" && $(MAKE) OBJDIR="$$PWD/objdir/" DESTDIR="$$PWD/destdir" uninstall)
(cd "$(PACKAGE)-$(VERSION)" && $(MAKE) OBJDIR="$$PWD/objdir/" distclean)
(cd "$(PACKAGE)-$(VERSION)" && $(MAKE) dist)
$(RM) -r -- $(PACKAGE)-$(VERSION)
install: install:
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) install) || exit; done @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) install) || exit; done
uninstall: uninstall:
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) uninstall) || exit; done @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) uninstall) || exit; done
.PHONY: all subdirs clean distclean dist install uninstall .PHONY: all subdirs clean distclean dist distcheck install uninstall

View File

@ -1,3 +1,4 @@
OBJDIR =
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
MKDIR = mkdir -m 0755 -p MKDIR = mkdir -m 0755 -p

View File

@ -1,3 +1,4 @@
OBJDIR =
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
MKDIR = mkdir -m 0755 -p MKDIR = mkdir -m 0755 -p

View File

@ -1,4 +1,5 @@
SUBDIRS = 16x16 24x24 SUBDIRS = 16x16 24x24
OBJDIR =
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
MKDIR = mkdir -m 0755 -p MKDIR = mkdir -m 0755 -p

View File

@ -1,4 +1,5 @@
TARGETS = download.1 download.html helper.1 helper.html surfer.1 surfer.html TARGETS = $(OBJDIR)download.1 $(OBJDIR)download.html $(OBJDIR)helper.1 $(OBJDIR)helper.html $(OBJDIR)surfer.1 $(OBJDIR)surfer.html
OBJDIR =
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
RM = rm -f RM = rm -f
@ -9,23 +10,23 @@ INSTALL = install
all: $(TARGETS) all: $(TARGETS)
download.1: download.xml $(OBJDIR)download.1: download.xml
./docbook.sh -P "$(PREFIX)" -- "download.1" ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)download.1"
download.html: download.css.xml download.xml manual.css.xml $(OBJDIR)download.html: download.css.xml download.xml manual.css.xml
./docbook.sh -P "$(PREFIX)" -- "download.html" ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)download.html"
helper.1: helper.xml $(OBJDIR)helper.1: helper.xml
./docbook.sh -P "$(PREFIX)" -- "helper.1" ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)helper.1"
helper.html: helper.css.xml helper.xml manual.css.xml $(OBJDIR)helper.html: helper.css.xml helper.xml manual.css.xml
./docbook.sh -P "$(PREFIX)" -- "helper.html" ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)helper.html"
surfer.1: surfer.xml $(OBJDIR)surfer.1: surfer.xml
./docbook.sh -P "$(PREFIX)" -- "surfer.1" ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)surfer.1"
surfer.html: manual.css.xml surfer.css.xml surfer.xml $(OBJDIR)surfer.html: manual.css.xml surfer.css.xml surfer.xml
./docbook.sh -P "$(PREFIX)" -- "surfer.html" ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)surfer.html"
clean: clean:
$(RM) -- $(download.1_OBJS) $(download.html_OBJS) $(helper.1_OBJS) $(helper.html_OBJS) $(surfer.1_OBJS) $(surfer.html_OBJS) $(RM) -- $(download.1_OBJS) $(download.html_OBJS) $(helper.1_OBJS) $(helper.html_OBJS) $(surfer.1_OBJS) $(surfer.html_OBJS)
@ -40,12 +41,12 @@ distclean: clean
$(RM) -- $(TARGETS) $(RM) -- $(TARGETS)
install: $(TARGETS) install: $(TARGETS)
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "download.1" ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)download.1"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "download.html" ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)download.html"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "helper.1" ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)helper.1"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "helper.html" ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)helper.html"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "surfer.1" ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)surfer.1"
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "surfer.html" ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)surfer.html"
uninstall: uninstall:
./docbook.sh -P "$(DESTDIR)$(PREFIX)" -u -- "download.1" ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -u -- "download.1"

View File

@ -27,6 +27,7 @@
#variables #variables
PREFIX="/usr/local" PREFIX="/usr/local"
[ -f "../config.sh" ] && . "../config.sh" [ -f "../config.sh" ] && . "../config.sh"
PROGNAME="docbook.sh"
#executables #executables
DEBUG="_debug" DEBUG="_debug"
FOP="fop" FOP="fop"
@ -52,17 +53,24 @@ _docbook()
target="$1" target="$1"
source="${target%.*}.xml" source="${target%.*}.xml"
[ -f "$source" ] || source="${source#$OBJDIR}"
ext="${target##*.}" ext="${target##*.}"
ext="${ext##.}" ext="${ext##.}"
case "$ext" in case "$ext" in
html) html)
XSL="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" XSL="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
[ -f "${source%.*}.xsl" ] && XSL="${source%.*}.xsl"
[ -f "${target%.*}.xsl" ] && XSL="${target%.*}.xsl" [ -f "${target%.*}.xsl" ] && XSL="${target%.*}.xsl"
[ -f "${target%.*}.css.xml" ] && XSLTPROC="$XSLTPROC --param custom.css.source \"${target%.*}.css.xml\" --param generate.css.header 1" if [ -f "${target%.*}.css.xml" ]; then
XSLTPROC="$XSLTPROC --param custom.css.source \"${target%.*}.css.xml\" --param generate.css.header 1"
elif [ -f "${source%.*}.css.xml" ]; then
XSLTPROC="$XSLTPROC --param custom.css.source \"${source%.*}.css.xml\" --param generate.css.header 1"
fi
$DEBUG $XSLTPROC -o "$target" "$XSL" "$source" $DEBUG $XSLTPROC -o "$target" "$XSL" "$source"
;; ;;
pdf) pdf)
XSL="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" XSL="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"
[ -f "${source%.*}.xsl" ] && XSL="${source%.*}.xsl"
[ -f "${target%.*}.xsl" ] && XSL="${target%.*}.xsl" [ -f "${target%.*}.xsl" ] && XSL="${target%.*}.xsl"
$DEBUG $XSLTPROC -o "${target%.*}.fo" "$XSL" "$source" && $DEBUG $XSLTPROC -o "${target%.*}.fo" "$XSL" "$source" &&
$DEBUG $FOP -fo "${target%.*}.fo" -pdf "$target" $DEBUG $FOP -fo "${target%.*}.fo" -pdf "$target"
@ -73,13 +81,13 @@ _docbook()
$DEBUG $XSLTPROC -o "$target" "$XSL" "$source" $DEBUG $XSLTPROC -o "$target" "$XSL" "$source"
;; ;;
*) *)
echo "$0: $target: Unknown type" 1>&2 _error "$target: Unknown type"
return 2 return 2
;; ;;
esac esac
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$0: $target: Could not create page" 1>&2 _error "$target: Could not create page"
$RM -- "$target" $RM -- "$target"
return 2 return 2
fi fi
@ -89,7 +97,7 @@ _docbook()
#error #error
_error() _error()
{ {
echo "docbook.sh: $@" 1>&2 echo "$PROGNAME: $@" 1>&2
return 2 return 2
} }
@ -97,7 +105,7 @@ _error()
#usage #usage
_usage() _usage()
{ {
echo "Usage: docbook.sh [-c|-i|-u][-P prefix] target..." 1>&2 echo "Usage: $PROGNAME [-c|-i|-u][-P prefix] target..." 1>&2
return 1 return 1
} }
@ -153,7 +161,8 @@ while [ $# -gt 0 ]; do
case "$ext" in case "$ext" in
html) html)
instdir="$DATADIR/doc/$ext/$PACKAGE" instdir="$DATADIR/doc/$ext/$PACKAGE"
source="${target%.*}.xml" source="${target#$OBJDIR}"
source="${source%.*}.xml"
xpath="string(/refentry/refmeta/manvolnum)" xpath="string(/refentry/refmeta/manvolnum)"
section=$($XMLLINT --xpath "$xpath" "$source") section=$($XMLLINT --xpath "$xpath" "$source")
if [ $? -eq 0 -a -n "$section" ]; then if [ $? -eq 0 -a -n "$section" ]; then
@ -167,7 +176,7 @@ while [ $# -gt 0 ]; do
instdir="$MANDIR/man$ext" instdir="$MANDIR/man$ext"
;; ;;
*) *)
echo "$0: $target: Unknown type" 1>&2 _error "$target: Unknown type"
exit 2 exit 2
;; ;;
esac esac
@ -177,14 +186,16 @@ while [ $# -gt 0 ]; do
#uninstall #uninstall
if [ "$uninstall" -eq 1 ]; then if [ "$uninstall" -eq 1 ]; then
target="${target#$OBJDIR}"
$DEBUG $RM -- "$instdir/$target" || exit 2 $DEBUG $RM -- "$instdir/$target" || exit 2
continue continue
fi fi
#install #install
if [ "$install" -eq 1 ]; then if [ "$install" -eq 1 ]; then
source="${target#$OBJDIR}"
$DEBUG $MKDIR -- "$instdir" || exit 2 $DEBUG $MKDIR -- "$instdir" || exit 2
$DEBUG $INSTALL "$target" "$instdir/$target" || exit 2 $DEBUG $INSTALL "$target" "$instdir/$source" || exit 2
continue continue
fi fi

View File

@ -1,4 +1,5 @@
TARGETS = Surfer.pot de.mo es.mo fr.mo it.mo TARGETS = $(OBJDIR)Surfer.pot $(OBJDIR)de.mo $(OBJDIR)es.mo $(OBJDIR)fr.mo $(OBJDIR)it.mo
OBJDIR =
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
RM = rm -f RM = rm -f
@ -9,20 +10,20 @@ INSTALL = install
all: $(TARGETS) all: $(TARGETS)
Surfer.pot: POTFILES $(OBJDIR)Surfer.pot: POTFILES
./gettext.sh -P "$(PREFIX)" -- "Surfer.pot" ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)Surfer.pot"
de.mo: Surfer.pot de.po $(OBJDIR)de.mo: $(OBJDIR)Surfer.pot de.po
./gettext.sh -P "$(PREFIX)" -- "de.mo" ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)de.mo"
es.mo: Surfer.pot es.po $(OBJDIR)es.mo: $(OBJDIR)Surfer.pot es.po
./gettext.sh -P "$(PREFIX)" -- "es.mo" ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)es.mo"
fr.mo: Surfer.pot fr.po $(OBJDIR)fr.mo: $(OBJDIR)Surfer.pot fr.po
./gettext.sh -P "$(PREFIX)" -- "fr.mo" ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)fr.mo"
it.mo: Surfer.pot it.po $(OBJDIR)it.mo: $(OBJDIR)Surfer.pot it.po
./gettext.sh -P "$(PREFIX)" -- "it.mo" ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)it.mo"
clean: clean:
$(RM) -- $(Surfer.pot_OBJS) $(de.mo_OBJS) $(es.mo_OBJS) $(fr.mo_OBJS) $(it.mo_OBJS) $(RM) -- $(Surfer.pot_OBJS) $(de.mo_OBJS) $(es.mo_OBJS) $(fr.mo_OBJS) $(it.mo_OBJS)
@ -36,10 +37,10 @@ distclean: clean
$(RM) -- $(TARGETS) $(RM) -- $(TARGETS)
install: $(TARGETS) install: $(TARGETS)
./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "de.mo" ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)de.mo"
./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "es.mo" ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)es.mo"
./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "fr.mo" ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)fr.mo"
./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "it.mo" ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)it.mo"
uninstall: uninstall:
./gettext.sh -P "$(DESTDIR)$(PREFIX)" -u -- "de.mo" ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -u -- "de.mo"

View File

@ -70,9 +70,12 @@ _gettext_mo()
{ {
package="$1" package="$1"
lang="$2" lang="$2"
potfile="$3"
pofile="$4"
mofile="$5"
_gettext_po "$package" "$lang" || return 1 _gettext_po "$package" "$lang" "$potfile" "$pofile" || return 1
$DEBUG $MSGFMT -c -v -o "$lang.mo" "$lang.po" || return 1 $DEBUG $MSGFMT -c -v -o "$mofile" "$pofile" || return 1
} }
@ -81,11 +84,13 @@ _gettext_po()
{ {
package="$1" package="$1"
lang="$2" lang="$2"
potfile="$3"
pofile="$4"
if [ -f "$lang.po" ]; then if [ -f "$pofile" ]; then
$DEBUG $MSGMERGE -U "$lang.po" "$package.pot" || return 1 $DEBUG $MSGMERGE -U "$pofile" "$potfile" || return 1
else else
$DEBUG $MSGINIT -l "$lang" -o "$lang.po" -i "$package.pot" \ $DEBUG $MSGINIT -l "$lang" -o "$pofile" -i "$potfile" \
|| return 1 || return 1
fi fi
} }
@ -95,8 +100,9 @@ _gettext_po()
_gettext_pot() _gettext_pot()
{ {
package="$1" package="$1"
potfile="$2"
$DEBUG $XGETTEXT -d "$package" -o "$package.pot" --keyword="_" \ $DEBUG $XGETTEXT -d "$package" -o "$potfile" --keyword="_" \
--keyword="N_" -f "$POTFILES" || return 1 --keyword="N_" -f "$POTFILES" || return 1
} }
@ -142,7 +148,8 @@ fi
LOCALEDIR="$PREFIX/share/locale" LOCALEDIR="$PREFIX/share/locale"
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
target="$1" target="$1"
lang="${target%%.mo}" source="${target#$OBJDIR}"
lang="${source%%.mo}"
lang="${lang%%.po}" lang="${lang%%.po}"
shift shift
@ -168,13 +175,32 @@ while [ $# -gt 0 ]; do
#create #create
case "$target" in case "$target" in
*.mo) *.mo)
_gettext_mo "$PACKAGE" "$lang" || exit 2 #XXX may not match
if [ -n "$OBJDIR" ]; then
potfile="$OBJDIR/$PACKAGE.pot"
else
potfile="$PACKAGE.pot"
fi
mofile="$target"
pofile="${source%%.mo}.po"
_gettext_mo "$PACKAGE" "$lang" "$potfile" "$pofile" \
"$mofile" || exit 2
;; ;;
*.po) *.po)
_gettext_po "$PACKAGE" "$lang" || exit 2 #XXX may not match
if [ -n "$OBJDIR" ]; then
potfile="$OBJDIR/$PACKAGE.pot"
else
potfile="$PACKAGE.pot"
fi
pofile="$target"
_gettext_po "$PACKAGE" "$lang" "$potfile" "$pofile" \
|| exit 2
;; ;;
*.pot) *.pot)
_gettext_pot "${target%%.pot}" || exit 2 package="${source%%.pot}"
potfile="$target"
_gettext_pot "$package" "$potfile" || exit 2
;; ;;
*) *)
exit 2 exit 2

View File

@ -10,22 +10,22 @@ depends=POTFILES
type=script type=script
script=./gettext.sh script=./gettext.sh
install= install=
depends=Surfer.pot,de.po depends=$(OBJDIR)Surfer.pot,de.po
[es.mo] [es.mo]
type=script type=script
script=./gettext.sh script=./gettext.sh
install= install=
depends=Surfer.pot,es.po depends=$(OBJDIR)Surfer.pot,es.po
[fr.mo] [fr.mo]
type=script type=script
script=./gettext.sh script=./gettext.sh
install= install=
depends=Surfer.pot,fr.po depends=$(OBJDIR)Surfer.pot,fr.po
[it.mo] [it.mo]
type=script type=script
script=./gettext.sh script=./gettext.sh
install= install=
depends=Surfer.pot,it.po depends=$(OBJDIR)Surfer.pot,it.po

View File

@ -1,5 +1,6 @@
SUBDIRS = common SUBDIRS = common
TARGETS = download surfer TARGETS = $(OBJDIR)download $(OBJDIR)surfer
OBJDIR =
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
@ -21,34 +22,34 @@ all: subdirs $(TARGETS)
subdirs: subdirs:
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE)) || exit; done @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE)) || exit; done
download_OBJS = download.o download_OBJS = $(OBJDIR)download.o
download_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) -D WITH_WEBKIT $(CFLAGSF) $(CFLAGS) `pkg-config --cflags libSystem gtk+-2.0 webkit-1.0` download_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) -D WITH_WEBKIT $(CFLAGSF) $(CFLAGS) `pkg-config --cflags libSystem gtk+-2.0 webkit-1.0`
download_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libSystem gtk+-2.0 webkit-1.0` -lintl download_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libSystem gtk+-2.0 webkit-1.0` -lintl
download: $(download_OBJS) $(OBJDIR)download: $(download_OBJS)
$(CC) -o download $(download_OBJS) $(download_LDFLAGS) $(CC) -o $(OBJDIR)download $(download_OBJS) $(download_LDFLAGS)
surfer_OBJS = surfer.o ghtml.o callbacks.o main.o surfer_OBJS = $(OBJDIR)surfer.o $(OBJDIR)ghtml.o $(OBJDIR)callbacks.o $(OBJDIR)main.o
surfer_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) -D WITH_WEBKIT $(CFLAGSF) $(CFLAGS) `pkg-config --cflags libDesktop webkit-1.0` surfer_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) -D WITH_WEBKIT $(CFLAGSF) $(CFLAGS) `pkg-config --cflags libDesktop webkit-1.0`
surfer_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libDesktop webkit-1.0` -lintl surfer_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libDesktop webkit-1.0` -lintl
surfer: $(surfer_OBJS) $(OBJDIR)surfer: $(surfer_OBJS)
$(CC) -o surfer $(surfer_OBJS) $(surfer_LDFLAGS) $(CC) -o $(OBJDIR)surfer $(surfer_OBJS) $(surfer_LDFLAGS)
download.o: download.c download.h ../config.h $(OBJDIR)download.o: download.c download.h ../config.h
$(CC) -D WITH_MAIN $(download_CFLAGS) -c download.c $(CC) -D WITH_MAIN $(download_CFLAGS) -o $(OBJDIR)download.o -c download.c
surfer.o: surfer.c callbacks.h common/find.c download.c download.h surfer.h ../config.h $(OBJDIR)surfer.o: surfer.c callbacks.h common/find.c download.c download.h surfer.h ../config.h
$(CC) $(surfer_CFLAGS) -c surfer.c $(CC) $(surfer_CFLAGS) -o $(OBJDIR)surfer.o -c surfer.c
ghtml.o: ghtml.c ghtml.h ghtml-gtkhtml.c ghtml-gtkmozembed.c ghtml-gtktextview.c ghtml-webkit.c common/conn.c common/history.c common/url.c ../config.h $(OBJDIR)ghtml.o: ghtml.c ghtml.h ghtml-gtkhtml.c ghtml-gtkmozembed.c ghtml-gtktextview.c ghtml-webkit.c common/conn.c common/history.c common/url.c ../config.h
$(CC) -D PREFIX=\"$(PREFIX)\" $(surfer_CFLAGS) -c ghtml.c $(CC) -D PREFIX=\"$(PREFIX)\" $(surfer_CFLAGS) -o $(OBJDIR)ghtml.o -c ghtml.c
callbacks.o: callbacks.c surfer.h ghtml.h callbacks.h ../config.h $(OBJDIR)callbacks.o: callbacks.c surfer.h ghtml.h callbacks.h ../config.h
$(CC) $(surfer_CFLAGS) -c callbacks.c $(CC) $(surfer_CFLAGS) -o $(OBJDIR)callbacks.o -c callbacks.c
main.o: main.c surfer.h ../config.h $(OBJDIR)main.o: main.c surfer.h ../config.h
$(CC) $(surfer_CFLAGS) -c main.c $(CC) $(surfer_CFLAGS) -o $(OBJDIR)main.o -c main.c
clean: clean:
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) clean) || exit; done @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) clean) || exit; done
@ -62,9 +63,9 @@ distclean:
install: $(TARGETS) install: $(TARGETS)
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) install) || exit; done @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) install) || exit; done
$(MKDIR) $(DESTDIR)$(BINDIR) $(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 0755 download $(DESTDIR)$(BINDIR)/download $(INSTALL) -m 0755 $(OBJDIR)download $(DESTDIR)$(BINDIR)/download
$(MKDIR) $(DESTDIR)$(BINDIR) $(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 0755 surfer $(DESTDIR)$(BINDIR)/surfer $(INSTALL) -m 0755 $(OBJDIR)surfer $(DESTDIR)$(BINDIR)/surfer
uninstall: uninstall:
@for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) uninstall) || exit; done @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) uninstall) || exit; done

View File

@ -1,4 +1,5 @@
TARGETS = helper TARGETS = $(OBJDIR)helper
OBJDIR =
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
@ -17,15 +18,15 @@ INSTALL = install
all: $(TARGETS) all: $(TARGETS)
helper_OBJS = helper.o helper_OBJS = $(OBJDIR)helper.o
helper_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) helper_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
helper_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libDesktop webkit-1.0` ../src/ghtml.o helper_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libDesktop webkit-1.0` ../src/ghtml.o
helper: $(helper_OBJS) ../src/ghtml.o $(OBJDIR)helper: $(helper_OBJS) ../src/ghtml.o
$(CC) -o helper $(helper_OBJS) $(helper_LDFLAGS) $(CC) -o $(OBJDIR)helper $(helper_OBJS) $(helper_LDFLAGS)
helper.o: helper.c ../src/common/find.c ../src/ghtml.c ../src/surfer.h ../config.h $(OBJDIR)helper.o: helper.c ../src/common/find.c ../src/ghtml.c ../src/surfer.h ../config.h
$(CC) -D WITH_WEBKIT $(helper_CFLAGS) -c helper.c $(CC) -D WITH_WEBKIT $(helper_CFLAGS) -o $(OBJDIR)helper.o -c helper.c
clean: clean:
$(RM) -- $(helper_OBJS) $(RM) -- $(helper_OBJS)
@ -35,7 +36,7 @@ distclean: clean
install: $(TARGETS) install: $(TARGETS)
$(MKDIR) $(DESTDIR)$(BINDIR) $(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 0755 helper $(DESTDIR)$(BINDIR)/helper $(INSTALL) -m 0755 $(OBJDIR)helper $(DESTDIR)$(BINDIR)/helper
uninstall: uninstall:
$(RM) -- $(DESTDIR)$(BINDIR)/helper $(RM) -- $(DESTDIR)$(BINDIR)/helper