From 34aa79ef13eb791829aea622b6b621756ad7c01c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 4 Nov 2014 00:58:49 +0100 Subject: [PATCH] Added partial support for building with OBJDIR --- Makefile | 18 +++++++++++++++--- data/16x16/Makefile | 1 + data/24x24/Makefile | 1 + data/Makefile | 1 + doc/Makefile | 39 +++++++++++++++++++------------------- doc/docbook.sh | 27 ++++++++++++++++++-------- po/Makefile | 31 +++++++++++++++--------------- po/gettext.sh | 46 +++++++++++++++++++++++++++++++++++---------- po/project.conf | 8 ++++---- src/Makefile | 39 +++++++++++++++++++------------------- tools/Makefile | 15 ++++++++------- 11 files changed, 141 insertions(+), 85 deletions(-) diff --git a/Makefile b/Makefile index 3ca35fb..78ccc86 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,8 @@ VERSION = 0.2.6 SUBDIRS = data doc po src tools RM = rm -f LN = ln -f -TAR = tar -czvf +TAR = tar +MKDIR = mkdir -m 0755 -p all: subdirs @@ -20,7 +21,7 @@ distclean: dist: $(RM) -r -- $(PACKAGE)-$(VERSION) $(LN) -s -- . $(PACKAGE)-$(VERSION) - @$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \ + @$(TAR) -czvf $(PACKAGE)-$(VERSION).tar.gz -- \ $(PACKAGE)-$(VERSION)/data/Makefile \ $(PACKAGE)-$(VERSION)/data/deforaos-helper.desktop \ $(PACKAGE)-$(VERSION)/data/deforaos-surfer.desktop \ @@ -81,10 +82,21 @@ dist: $(PACKAGE)-$(VERSION)/project.conf $(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: @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) install) || exit; done uninstall: @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 diff --git a/data/16x16/Makefile b/data/16x16/Makefile index 79ca59b..abcb45c 100644 --- a/data/16x16/Makefile +++ b/data/16x16/Makefile @@ -1,3 +1,4 @@ +OBJDIR = PREFIX = /usr/local DESTDIR = MKDIR = mkdir -m 0755 -p diff --git a/data/24x24/Makefile b/data/24x24/Makefile index e12d688..5ad38c2 100644 --- a/data/24x24/Makefile +++ b/data/24x24/Makefile @@ -1,3 +1,4 @@ +OBJDIR = PREFIX = /usr/local DESTDIR = MKDIR = mkdir -m 0755 -p diff --git a/data/Makefile b/data/Makefile index 715655b..a91cdd3 100644 --- a/data/Makefile +++ b/data/Makefile @@ -1,4 +1,5 @@ SUBDIRS = 16x16 24x24 +OBJDIR = PREFIX = /usr/local DESTDIR = MKDIR = mkdir -m 0755 -p diff --git a/doc/Makefile b/doc/Makefile index 5c81794..c9e2a3e 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -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 DESTDIR = RM = rm -f @@ -9,23 +10,23 @@ INSTALL = install all: $(TARGETS) -download.1: download.xml - ./docbook.sh -P "$(PREFIX)" -- "download.1" +$(OBJDIR)download.1: download.xml + ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)download.1" -download.html: download.css.xml download.xml manual.css.xml - ./docbook.sh -P "$(PREFIX)" -- "download.html" +$(OBJDIR)download.html: download.css.xml download.xml manual.css.xml + ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)download.html" -helper.1: helper.xml - ./docbook.sh -P "$(PREFIX)" -- "helper.1" +$(OBJDIR)helper.1: helper.xml + ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)helper.1" -helper.html: helper.css.xml helper.xml manual.css.xml - ./docbook.sh -P "$(PREFIX)" -- "helper.html" +$(OBJDIR)helper.html: helper.css.xml helper.xml manual.css.xml + ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)helper.html" -surfer.1: surfer.xml - ./docbook.sh -P "$(PREFIX)" -- "surfer.1" +$(OBJDIR)surfer.1: surfer.xml + ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)surfer.1" -surfer.html: manual.css.xml surfer.css.xml surfer.xml - ./docbook.sh -P "$(PREFIX)" -- "surfer.html" +$(OBJDIR)surfer.html: manual.css.xml surfer.css.xml surfer.xml + ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)surfer.html" clean: $(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) install: $(TARGETS) - ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "download.1" - ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "download.html" - ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "helper.1" - ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "helper.html" - ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "surfer.1" - ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "surfer.html" + ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)download.1" + ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)download.html" + ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)helper.1" + ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)helper.html" + ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)surfer.1" + ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)surfer.html" uninstall: ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -u -- "download.1" diff --git a/doc/docbook.sh b/doc/docbook.sh index 0caaa39..fda4e2d 100755 --- a/doc/docbook.sh +++ b/doc/docbook.sh @@ -27,6 +27,7 @@ #variables PREFIX="/usr/local" [ -f "../config.sh" ] && . "../config.sh" +PROGNAME="docbook.sh" #executables DEBUG="_debug" FOP="fop" @@ -52,17 +53,24 @@ _docbook() target="$1" source="${target%.*}.xml" + [ -f "$source" ] || source="${source#$OBJDIR}" ext="${target##*.}" ext="${ext##.}" case "$ext" in html) 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%.*}.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" ;; pdf) XSL="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + [ -f "${source%.*}.xsl" ] && XSL="${source%.*}.xsl" [ -f "${target%.*}.xsl" ] && XSL="${target%.*}.xsl" $DEBUG $XSLTPROC -o "${target%.*}.fo" "$XSL" "$source" && $DEBUG $FOP -fo "${target%.*}.fo" -pdf "$target" @@ -73,13 +81,13 @@ _docbook() $DEBUG $XSLTPROC -o "$target" "$XSL" "$source" ;; *) - echo "$0: $target: Unknown type" 1>&2 + _error "$target: Unknown type" return 2 ;; esac if [ $? -ne 0 ]; then - echo "$0: $target: Could not create page" 1>&2 + _error "$target: Could not create page" $RM -- "$target" return 2 fi @@ -89,7 +97,7 @@ _docbook() #error _error() { - echo "docbook.sh: $@" 1>&2 + echo "$PROGNAME: $@" 1>&2 return 2 } @@ -97,7 +105,7 @@ _error() #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 } @@ -153,7 +161,8 @@ while [ $# -gt 0 ]; do case "$ext" in html) instdir="$DATADIR/doc/$ext/$PACKAGE" - source="${target%.*}.xml" + source="${target#$OBJDIR}" + source="${source%.*}.xml" xpath="string(/refentry/refmeta/manvolnum)" section=$($XMLLINT --xpath "$xpath" "$source") if [ $? -eq 0 -a -n "$section" ]; then @@ -167,7 +176,7 @@ while [ $# -gt 0 ]; do instdir="$MANDIR/man$ext" ;; *) - echo "$0: $target: Unknown type" 1>&2 + _error "$target: Unknown type" exit 2 ;; esac @@ -177,14 +186,16 @@ while [ $# -gt 0 ]; do #uninstall if [ "$uninstall" -eq 1 ]; then + target="${target#$OBJDIR}" $DEBUG $RM -- "$instdir/$target" || exit 2 continue fi #install if [ "$install" -eq 1 ]; then + source="${target#$OBJDIR}" $DEBUG $MKDIR -- "$instdir" || exit 2 - $DEBUG $INSTALL "$target" "$instdir/$target" || exit 2 + $DEBUG $INSTALL "$target" "$instdir/$source" || exit 2 continue fi diff --git a/po/Makefile b/po/Makefile index e6f0092..77ef861 100644 --- a/po/Makefile +++ b/po/Makefile @@ -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 DESTDIR = RM = rm -f @@ -9,20 +10,20 @@ INSTALL = install all: $(TARGETS) -Surfer.pot: POTFILES - ./gettext.sh -P "$(PREFIX)" -- "Surfer.pot" +$(OBJDIR)Surfer.pot: POTFILES + ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)Surfer.pot" -de.mo: Surfer.pot de.po - ./gettext.sh -P "$(PREFIX)" -- "de.mo" +$(OBJDIR)de.mo: $(OBJDIR)Surfer.pot de.po + ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)de.mo" -es.mo: Surfer.pot es.po - ./gettext.sh -P "$(PREFIX)" -- "es.mo" +$(OBJDIR)es.mo: $(OBJDIR)Surfer.pot es.po + ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)es.mo" -fr.mo: Surfer.pot fr.po - ./gettext.sh -P "$(PREFIX)" -- "fr.mo" +$(OBJDIR)fr.mo: $(OBJDIR)Surfer.pot fr.po + ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)fr.mo" -it.mo: Surfer.pot it.po - ./gettext.sh -P "$(PREFIX)" -- "it.mo" +$(OBJDIR)it.mo: $(OBJDIR)Surfer.pot it.po + ./gettext.sh -P "$(PREFIX)" -- "$(OBJDIR)it.mo" clean: $(RM) -- $(Surfer.pot_OBJS) $(de.mo_OBJS) $(es.mo_OBJS) $(fr.mo_OBJS) $(it.mo_OBJS) @@ -36,10 +37,10 @@ distclean: clean $(RM) -- $(TARGETS) install: $(TARGETS) - ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "de.mo" - ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "es.mo" - ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "fr.mo" - ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "it.mo" + ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)de.mo" + ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)es.mo" + ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)fr.mo" + ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)it.mo" uninstall: ./gettext.sh -P "$(DESTDIR)$(PREFIX)" -u -- "de.mo" diff --git a/po/gettext.sh b/po/gettext.sh index 11a8805..c3ae919 100755 --- a/po/gettext.sh +++ b/po/gettext.sh @@ -70,9 +70,12 @@ _gettext_mo() { package="$1" lang="$2" + potfile="$3" + pofile="$4" + mofile="$5" - _gettext_po "$package" "$lang" || return 1 - $DEBUG $MSGFMT -c -v -o "$lang.mo" "$lang.po" || return 1 + _gettext_po "$package" "$lang" "$potfile" "$pofile" || return 1 + $DEBUG $MSGFMT -c -v -o "$mofile" "$pofile" || return 1 } @@ -81,11 +84,13 @@ _gettext_po() { package="$1" lang="$2" + potfile="$3" + pofile="$4" - if [ -f "$lang.po" ]; then - $DEBUG $MSGMERGE -U "$lang.po" "$package.pot" || return 1 + if [ -f "$pofile" ]; then + $DEBUG $MSGMERGE -U "$pofile" "$potfile" || return 1 else - $DEBUG $MSGINIT -l "$lang" -o "$lang.po" -i "$package.pot" \ + $DEBUG $MSGINIT -l "$lang" -o "$pofile" -i "$potfile" \ || return 1 fi } @@ -95,8 +100,9 @@ _gettext_po() _gettext_pot() { 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 } @@ -142,7 +148,8 @@ fi LOCALEDIR="$PREFIX/share/locale" while [ $# -gt 0 ]; do target="$1" - lang="${target%%.mo}" + source="${target#$OBJDIR}" + lang="${source%%.mo}" lang="${lang%%.po}" shift @@ -168,13 +175,32 @@ while [ $# -gt 0 ]; do #create case "$target" in *.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) - _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) - _gettext_pot "${target%%.pot}" || exit 2 + package="${source%%.pot}" + potfile="$target" + _gettext_pot "$package" "$potfile" || exit 2 ;; *) exit 2 diff --git a/po/project.conf b/po/project.conf index e364d56..cb03bbd 100644 --- a/po/project.conf +++ b/po/project.conf @@ -10,22 +10,22 @@ depends=POTFILES type=script script=./gettext.sh install= -depends=Surfer.pot,de.po +depends=$(OBJDIR)Surfer.pot,de.po [es.mo] type=script script=./gettext.sh install= -depends=Surfer.pot,es.po +depends=$(OBJDIR)Surfer.pot,es.po [fr.mo] type=script script=./gettext.sh install= -depends=Surfer.pot,fr.po +depends=$(OBJDIR)Surfer.pot,fr.po [it.mo] type=script script=./gettext.sh install= -depends=Surfer.pot,it.po +depends=$(OBJDIR)Surfer.pot,it.po diff --git a/src/Makefile b/src/Makefile index 504ca59..d1f20b5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,6 @@ SUBDIRS = common -TARGETS = download surfer +TARGETS = $(OBJDIR)download $(OBJDIR)surfer +OBJDIR = PREFIX = /usr/local DESTDIR = BINDIR = $(PREFIX)/bin @@ -21,34 +22,34 @@ all: subdirs $(TARGETS) subdirs: @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_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libSystem gtk+-2.0 webkit-1.0` -lintl -download: $(download_OBJS) - $(CC) -o download $(download_OBJS) $(download_LDFLAGS) +$(OBJDIR)download: $(download_OBJS) + $(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_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libDesktop webkit-1.0` -lintl -surfer: $(surfer_OBJS) - $(CC) -o surfer $(surfer_OBJS) $(surfer_LDFLAGS) +$(OBJDIR)surfer: $(surfer_OBJS) + $(CC) -o $(OBJDIR)surfer $(surfer_OBJS) $(surfer_LDFLAGS) -download.o: download.c download.h ../config.h - $(CC) -D WITH_MAIN $(download_CFLAGS) -c download.c +$(OBJDIR)download.o: download.c download.h ../config.h + $(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 - $(CC) $(surfer_CFLAGS) -c surfer.c +$(OBJDIR)surfer.o: surfer.c callbacks.h common/find.c download.c download.h surfer.h ../config.h + $(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 - $(CC) -D PREFIX=\"$(PREFIX)\" $(surfer_CFLAGS) -c ghtml.c +$(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) -o $(OBJDIR)ghtml.o -c ghtml.c -callbacks.o: callbacks.c surfer.h ghtml.h callbacks.h ../config.h - $(CC) $(surfer_CFLAGS) -c callbacks.c +$(OBJDIR)callbacks.o: callbacks.c surfer.h ghtml.h callbacks.h ../config.h + $(CC) $(surfer_CFLAGS) -o $(OBJDIR)callbacks.o -c callbacks.c -main.o: main.c surfer.h ../config.h - $(CC) $(surfer_CFLAGS) -c main.c +$(OBJDIR)main.o: main.c surfer.h ../config.h + $(CC) $(surfer_CFLAGS) -o $(OBJDIR)main.o -c main.c clean: @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) clean) || exit; done @@ -62,9 +63,9 @@ distclean: install: $(TARGETS) @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) install) || exit; done $(MKDIR) $(DESTDIR)$(BINDIR) - $(INSTALL) -m 0755 download $(DESTDIR)$(BINDIR)/download + $(INSTALL) -m 0755 $(OBJDIR)download $(DESTDIR)$(BINDIR)/download $(MKDIR) $(DESTDIR)$(BINDIR) - $(INSTALL) -m 0755 surfer $(DESTDIR)$(BINDIR)/surfer + $(INSTALL) -m 0755 $(OBJDIR)surfer $(DESTDIR)$(BINDIR)/surfer uninstall: @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) uninstall) || exit; done diff --git a/tools/Makefile b/tools/Makefile index 5021847..eab48dd 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,4 +1,5 @@ -TARGETS = helper +TARGETS = $(OBJDIR)helper +OBJDIR = PREFIX = /usr/local DESTDIR = BINDIR = $(PREFIX)/bin @@ -17,15 +18,15 @@ INSTALL = install all: $(TARGETS) -helper_OBJS = helper.o +helper_OBJS = $(OBJDIR)helper.o helper_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) helper_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libDesktop webkit-1.0` ../src/ghtml.o -helper: $(helper_OBJS) ../src/ghtml.o - $(CC) -o helper $(helper_OBJS) $(helper_LDFLAGS) +$(OBJDIR)helper: $(helper_OBJS) ../src/ghtml.o + $(CC) -o $(OBJDIR)helper $(helper_OBJS) $(helper_LDFLAGS) -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 +$(OBJDIR)helper.o: helper.c ../src/common/find.c ../src/ghtml.c ../src/surfer.h ../config.h + $(CC) -D WITH_WEBKIT $(helper_CFLAGS) -o $(OBJDIR)helper.o -c helper.c clean: $(RM) -- $(helper_OBJS) @@ -35,7 +36,7 @@ distclean: clean install: $(TARGETS) $(MKDIR) $(DESTDIR)$(BINDIR) - $(INSTALL) -m 0755 helper $(DESTDIR)$(BINDIR)/helper + $(INSTALL) -m 0755 $(OBJDIR)helper $(DESTDIR)$(BINDIR)/helper uninstall: $(RM) -- $(DESTDIR)$(BINDIR)/helper