diff --git a/Makefile b/Makefile index 35bf11d..7851b33 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ PACKAGE = libSystem VERSION = 0.2.0 SUBDIRS = data doc include src tests tools +OBJDIR = PREFIX = /usr/local DESTDIR = MKDIR = mkdir -m 0755 -p @@ -8,7 +9,8 @@ INSTALL = install RM = rm -f RM = rm -f LN = ln -f -TAR = tar -czvf +TAR = tar +MKDIR = mkdir -m 0755 -p all: subdirs @@ -25,7 +27,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/libSystem.pc.in \ $(PACKAGE)-$(VERSION)/data/pkgconfig.sh \ @@ -115,6 +117,17 @@ 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 $(MKDIR) $(DESTDIR)$(PREFIX)/share/doc/$(PACKAGE) @@ -124,4 +137,4 @@ uninstall: @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) uninstall) || exit; done $(RM) -- $(DESTDIR)$(PREFIX)/share/doc/$(PACKAGE)/README.md -.PHONY: all subdirs clean distclean dist install uninstall +.PHONY: all subdirs clean distclean dist distcheck install uninstall diff --git a/data/Makefile b/data/Makefile index 44db5bf..a555bae 100644 --- a/data/Makefile +++ b/data/Makefile @@ -1,4 +1,5 @@ -TARGETS = libSystem.pc +TARGETS = $(OBJDIR)libSystem.pc +OBJDIR = PREFIX = /usr/local DESTDIR = RM = rm -f @@ -9,8 +10,8 @@ INSTALL = install all: $(TARGETS) -libSystem.pc: libSystem.pc.in ../config.sh - ./pkgconfig.sh -P "$(PREFIX)" -- "libSystem.pc" +$(OBJDIR)libSystem.pc: libSystem.pc.in ../config.sh + ./pkgconfig.sh -P "$(PREFIX)" -- "$(OBJDIR)libSystem.pc" clean: $(RM) -- $(libSystem.pc_OBJS) @@ -20,7 +21,7 @@ distclean: clean $(RM) -- $(TARGETS) install: $(TARGETS) - ./pkgconfig.sh -P "$(DESTDIR)$(PREFIX)" -i -- "libSystem.pc" + ./pkgconfig.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)libSystem.pc" uninstall: ./pkgconfig.sh -P "$(DESTDIR)$(PREFIX)" -u -- "libSystem.pc" diff --git a/data/pkgconfig.sh b/data/pkgconfig.sh index 5482795..95a0ac9 100755 --- a/data/pkgconfig.sh +++ b/data/pkgconfig.sh @@ -119,8 +119,9 @@ while [ $# -gt 0 ]; do #install if [ "$install" -eq 1 ]; then + source="${target#$OBJDIR}" $DEBUG $MKDIR -- "$PKGCONFIG" || exit 2 - $DEBUG $INSTALL "$target" "$PKGCONFIG/$target" || exit 2 + $DEBUG $INSTALL "$target" "$PKGCONFIG/$source" || exit 2 continue fi @@ -129,18 +130,23 @@ while [ $# -gt 0 ]; do if [ "$PREFIX" != "/usr" ]; then RPATH="-Wl,-rpath-link,\${libdir} -Wl,-rpath,\${libdir}" case $(uname -s) in - Darwin|SunOS) + Darwin) RPATH="-Wl,-rpath,\${libdir}" ;; + SunOS) + RPATH="-Wl,-R\${libdir}" + ;; esac fi #create + source="${target#$OBJDIR}" + source="${source}.in" $DEBUG $SED -e "s;@PACKAGE@;$PACKAGE;" \ -e "s;@VERSION@;$VERSION;" \ -e "s;@PREFIX@;$PREFIX;" \ -e "s;@RPATH@;$RPATH;" \ - -- "$target.in" > "$target" + -- "$source" > "$target" if [ $? -ne 0 ]; then $DEBUG $RM -- "$target" exit 2 diff --git a/doc/Makefile b/doc/Makefile index 46a7940..8fc7f97 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,5 +1,6 @@ SUBDIRS = gtkdoc -TARGETS = configctl.1 configctl.html gtkdoc/libSystem.types gtkdoc/tmpl.stamp gtkdoc/sgml.stamp gtkdoc/html.stamp +TARGETS = $(OBJDIR)configctl.1 $(OBJDIR)configctl.html $(OBJDIR)gtkdoc/libSystem.types $(OBJDIR)gtkdoc/tmpl.stamp $(OBJDIR)gtkdoc/sgml.stamp $(OBJDIR)gtkdoc/html.stamp +OBJDIR = PREFIX = /usr/local DESTDIR = RM = rm -f @@ -13,23 +14,23 @@ all: subdirs $(TARGETS) subdirs: @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE)) || exit; done -configctl.1: configctl.xml - ./docbook.sh -P "$(PREFIX)" -- "configctl.1" +$(OBJDIR)configctl.1: configctl.xml + ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)configctl.1" -configctl.html: configctl.css.xml configctl.xml manual.css.xml - ./docbook.sh -P "$(PREFIX)" -- "configctl.html" +$(OBJDIR)configctl.html: configctl.css.xml configctl.xml manual.css.xml + ./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)configctl.html" -gtkdoc/libSystem.types: - ./gtkdoc.sh -P "$(PREFIX)" -- "gtkdoc/libSystem.types" +$(OBJDIR)gtkdoc/libSystem.types: + ./gtkdoc.sh -P "$(PREFIX)" -- "$(OBJDIR)gtkdoc/libSystem.types" -gtkdoc/tmpl.stamp: gtkdoc/libSystem.types - ./gtkdoc.sh -P "$(PREFIX)" -- "gtkdoc/tmpl.stamp" +$(OBJDIR)gtkdoc/tmpl.stamp: gtkdoc/libSystem.types + ./gtkdoc.sh -P "$(PREFIX)" -- "$(OBJDIR)gtkdoc/tmpl.stamp" -gtkdoc/sgml.stamp: gtkdoc/tmpl.stamp - ./gtkdoc.sh -P "$(PREFIX)" -- "gtkdoc/sgml.stamp" +$(OBJDIR)gtkdoc/sgml.stamp: gtkdoc/tmpl.stamp + ./gtkdoc.sh -P "$(PREFIX)" -- "$(OBJDIR)gtkdoc/sgml.stamp" -gtkdoc/html.stamp: gtkdoc/libSystem-docs.xml gtkdoc/sgml.stamp gtkdoc/tmpl.stamp - ./gtkdoc.sh -P "$(PREFIX)" -- "gtkdoc/html.stamp" +$(OBJDIR)gtkdoc/html.stamp: gtkdoc/libSystem-docs.xml gtkdoc/sgml.stamp gtkdoc/tmpl.stamp + ./gtkdoc.sh -P "$(PREFIX)" -- "$(OBJDIR)gtkdoc/html.stamp" clean: @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) clean) || exit; done @@ -54,9 +55,9 @@ distclean: install: $(TARGETS) @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) install) || exit; done - ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "configctl.1" - ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "configctl.html" - ./gtkdoc.sh -P "$(DESTDIR)$(PREFIX)" -i -- "gtkdoc/html.stamp" + ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)configctl.1" + ./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)configctl.html" + ./gtkdoc.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)gtkdoc/html.stamp" uninstall: @for i in $(SUBDIRS); do (cd "$$i" && $(MAKE) uninstall) || exit; done diff --git a/doc/docbook.sh b/doc/docbook.sh index 0caaa39..4ac88b6 100755 --- a/doc/docbook.sh +++ b/doc/docbook.sh @@ -51,7 +51,8 @@ _docbook() { target="$1" - source="${target%.*}.xml" + source="${target#$OBJDIR}" + source="${source%.*}.xml" ext="${target##*.}" ext="${ext##.}" case "$ext" in @@ -153,7 +154,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 @@ -177,14 +179,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/include/Makefile b/include/Makefile index 6213adb..a85a4be 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,4 +1,5 @@ SUBDIRS = System +OBJDIR = PREFIX = /usr/local DESTDIR = RM = rm -f diff --git a/include/System/Makefile b/include/System/Makefile index e9d09fc..060942b 100644 --- a/include/System/Makefile +++ b/include/System/Makefile @@ -1,3 +1,4 @@ +OBJDIR = PREFIX = /usr/local DESTDIR = RM = rm -f diff --git a/src/Makefile b/src/Makefile index 513d206..0cec840 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,5 @@ -TARGETS = libSystem.a libSystem.so.0.0 libSystem.so.0 libSystem.so +TARGETS = $(OBJDIR)libSystem.a $(OBJDIR)libSystem.so.0.0 $(OBJDIR)libSystem.so.0 $(OBJDIR)libSystem.so +OBJDIR = PREFIX = /usr/local DESTDIR = LIBDIR = $(PREFIX)/lib @@ -19,57 +20,57 @@ INSTALL = install all: $(TARGETS) -libSystem_OBJS = array.o buffer.o config.o error.o event.o hash.o mutator.o object.o parser.o plugin.o string.o token.o variable.o +libSystem_OBJS = $(OBJDIR)array.o $(OBJDIR)buffer.o $(OBJDIR)config.o $(OBJDIR)error.o $(OBJDIR)event.o $(OBJDIR)hash.o $(OBJDIR)mutator.o $(OBJDIR)object.o $(OBJDIR)parser.o $(OBJDIR)plugin.o $(OBJDIR)string.o $(OBJDIR)token.o $(OBJDIR)variable.o libSystem_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) libSystem_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) -libSystem.a: $(libSystem_OBJS) - $(AR) -rc libSystem.a $(libSystem_OBJS) - $(RANLIB) libSystem.a +$(OBJDIR)libSystem.a: $(libSystem_OBJS) + $(AR) -rc $(OBJDIR)libSystem.a $(libSystem_OBJS) + $(RANLIB) $(OBJDIR)libSystem.a -libSystem.so.0.0 libSystem.so.0 libSystem.so: $(libSystem_OBJS) - $(CCSHARED) -o libSystem.so.0.0 -Wl,-soname,libSystem.so.0 $(libSystem_OBJS) $(libSystem_LDFLAGS) - $(LN) -s -- libSystem.so.0.0 libSystem.so.0 - $(LN) -s -- libSystem.so.0.0 libSystem.so +$(OBJDIR)libSystem.so.0.0 $(OBJDIR)libSystem.so.0 $(OBJDIR)libSystem.so: $(libSystem_OBJS) + $(CCSHARED) -o $(OBJDIR)libSystem.so.0.0 -Wl,-soname,libSystem.so.0 $(libSystem_OBJS) $(libSystem_LDFLAGS) + $(LN) -s -- libSystem.so.0.0 $(OBJDIR)libSystem.so.0 + $(LN) -s -- libSystem.so.0.0 $(OBJDIR)libSystem.so -array.o: array.c - $(CC) $(libSystem_CFLAGS) -c array.c +$(OBJDIR)array.o: array.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)array.o -c array.c -buffer.o: buffer.c - $(CC) $(libSystem_CFLAGS) -c buffer.c +$(OBJDIR)buffer.o: buffer.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)buffer.o -c buffer.c -config.o: config.c - $(CC) $(libSystem_CFLAGS) -c config.c +$(OBJDIR)config.o: config.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)config.o -c config.c -error.o: error.c - $(CC) $(libSystem_CFLAGS) -c error.c +$(OBJDIR)error.o: error.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)error.o -c error.c -event.o: event.c - $(CC) $(libSystem_CFLAGS) -c event.c +$(OBJDIR)event.o: event.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)event.o -c event.c -hash.o: hash.c - $(CC) $(libSystem_CFLAGS) -c hash.c +$(OBJDIR)hash.o: hash.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)hash.o -c hash.c -mutator.o: mutator.c - $(CC) $(libSystem_CFLAGS) -c mutator.c +$(OBJDIR)mutator.o: mutator.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)mutator.o -c mutator.c -object.o: object.c - $(CC) $(libSystem_CFLAGS) -c object.c +$(OBJDIR)object.o: object.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)object.o -c object.c -parser.o: parser.c token.h - $(CC) $(libSystem_CFLAGS) -c parser.c +$(OBJDIR)parser.o: parser.c token.h + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)parser.o -c parser.c -plugin.o: plugin.c - $(CC) $(libSystem_CFLAGS) -c plugin.c +$(OBJDIR)plugin.o: plugin.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)plugin.o -c plugin.c -string.o: string.c - $(CC) $(libSystem_CFLAGS) -c string.c +$(OBJDIR)string.o: string.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)string.o -c string.c -token.o: token.c token.h - $(CC) $(libSystem_CFLAGS) -c token.c +$(OBJDIR)token.o: token.c token.h + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)token.o -c token.c -variable.o: variable.c - $(CC) $(libSystem_CFLAGS) -c variable.c +$(OBJDIR)variable.o: variable.c + $(CC) $(libSystem_CFLAGS) -o $(OBJDIR)variable.o -c variable.c clean: $(RM) -- $(libSystem_OBJS) @@ -79,8 +80,8 @@ distclean: clean install: $(TARGETS) $(MKDIR) $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 0644 libSystem.a $(DESTDIR)$(LIBDIR)/libSystem.a - $(INSTALL) -m 0755 libSystem.so.0.0 $(DESTDIR)$(LIBDIR)/libSystem.so.0.0 + $(INSTALL) -m 0644 $(OBJDIR)libSystem.a $(DESTDIR)$(LIBDIR)/libSystem.a + $(INSTALL) -m 0755 $(OBJDIR)libSystem.so.0.0 $(DESTDIR)$(LIBDIR)/libSystem.so.0.0 $(LN) -s -- libSystem.so.0.0 $(DESTDIR)$(LIBDIR)/libSystem.so.0 $(LN) -s -- libSystem.so.0.0 $(DESTDIR)$(LIBDIR)/libSystem.so diff --git a/src/python/Makefile b/src/python/Makefile index 35f5fd1..4f5c1fc 100644 --- a/src/python/Makefile +++ b/src/python/Makefile @@ -1,7 +1,8 @@ -MKDIR = mkdir -p +MKDIR = mkdir -m 0755 -p INSTALL = install RM = rm -f -TARGETS = _libSystem.so +TARGETS = $(OBJDIR)_libSystem.so +OBJDIR = PREFIX = /usr/local DESTDIR = LIBDIR = $(PREFIX)/lib @@ -17,21 +18,21 @@ RANLIB = ranlib CCSHARED= $(CC) -shared RM = rm -f LN = ln -f -MKDIR = mkdir -p +MKDIR = mkdir -m 0755 -p INSTALL = install all: $(TARGETS) -_libSystem_OBJS = libSystem.o +_libSystem_OBJS = $(OBJDIR)libSystem.o _libSystem_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) _libSystem_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) -_libSystem.so: $(_libSystem_OBJS) - $(CCSHARED) -o _libSystem.so $(_libSystem_OBJS) $(_libSystem_LDFLAGS) +$(OBJDIR)_libSystem.so: $(_libSystem_OBJS) + $(CCSHARED) -o $(OBJDIR)_libSystem.so $(_libSystem_OBJS) $(_libSystem_LDFLAGS) -libSystem.o: libSystem.c - $(CC) $(_libSystem_CFLAGS) -c libSystem.c +$(OBJDIR)libSystem.o: libSystem.c + $(CC) $(_libSystem_CFLAGS) -o $(OBJDIR)libSystem.o -c libSystem.c clean: $(RM) -- $(_libSystem_OBJS) @@ -41,9 +42,9 @@ distclean: clean install: $(TARGETS) $(MKDIR) $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages - $(INSTALL) -m 0644 -- _libSystem.so $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages/_libSystem.so + $(INSTALL) -m 0755 $(OBJDIR)_libSystem.so $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages/_libSystem.so $(MKDIR) $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages - $(INSTALL) -m 0644 -- libSystem.py $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages/libSystem.py + $(INSTALL) -m 0644 libSystem.py $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages/libSystem.py uninstall: $(RM) -- $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages/_libSystem.so diff --git a/tests/Makefile b/tests/Makefile index f445583..9f86e9e 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,4 +1,5 @@ -TARGETS = includes string variable tests.log +TARGETS = $(OBJDIR)includes $(OBJDIR)string $(OBJDIR)variable $(OBJDIR)tests.log +OBJDIR = PREFIX = /usr/local DESTDIR = BINDIR = $(PREFIX)/bin @@ -18,38 +19,38 @@ INSTALL = install all: $(TARGETS) -includes_OBJS = includes.o +includes_OBJS = $(OBJDIR)includes.o includes_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) includes_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) -includes: $(includes_OBJS) - $(CC) -o includes $(includes_OBJS) $(includes_LDFLAGS) +$(OBJDIR)includes: $(includes_OBJS) + $(CC) -o $(OBJDIR)includes $(includes_OBJS) $(includes_LDFLAGS) -string_OBJS = string.o +string_OBJS = $(OBJDIR)string.o string_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) string_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) -string: $(string_OBJS) - $(CC) -o string $(string_OBJS) $(string_LDFLAGS) +$(OBJDIR)string: $(string_OBJS) + $(CC) -o $(OBJDIR)string $(string_OBJS) $(string_LDFLAGS) -variable_OBJS = variable.o +variable_OBJS = $(OBJDIR)variable.o variable_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) variable_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) -variable: $(variable_OBJS) - $(CC) -o variable $(variable_OBJS) $(variable_LDFLAGS) +$(OBJDIR)variable: $(variable_OBJS) + $(CC) -o $(OBJDIR)variable $(variable_OBJS) $(variable_LDFLAGS) -tests.log: includes python.sh string tests.sh variable - ./tests.sh -P "$(PREFIX)" -- "tests.log" +$(OBJDIR)tests.log: includes python.sh string tests.sh variable + ./tests.sh -P "$(PREFIX)" -- "$(OBJDIR)tests.log" -includes.o: includes.c - $(CC) $(includes_CFLAGS) -c includes.c +$(OBJDIR)includes.o: includes.c + $(CC) $(includes_CFLAGS) -o $(OBJDIR)includes.o -c includes.c -string.o: string.c ../src/string.c - $(CC) $(string_CFLAGS) -c string.c +$(OBJDIR)string.o: string.c ../src/string.c + $(CC) $(string_CFLAGS) -o $(OBJDIR)string.o -c string.c -variable.o: variable.c ../src/variable.c - $(CC) $(variable_CFLAGS) -c variable.c +$(OBJDIR)variable.o: variable.c ../src/variable.c + $(CC) $(variable_CFLAGS) -o $(OBJDIR)variable.o -c variable.c clean: $(RM) -- $(includes_OBJS) $(string_OBJS) $(variable_OBJS) $(tests.log_OBJS) diff --git a/tests/python.sh b/tests/python.sh index 19561ed..2a2463b 100755 --- a/tests/python.sh +++ b/tests/python.sh @@ -17,8 +17,9 @@ #variables +PYTHONDIR="../src/python" #executables MAKE="make" -(cd ../src/python && $MAKE clean all) +(cd "$PYTHONDIR" && $MAKE clean all) diff --git a/tools/Makefile b/tools/Makefile index adae099..7a659da 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,4 +1,5 @@ -TARGETS = configctl +TARGETS = $(OBJDIR)configctl +OBJDIR = PREFIX = /usr/local DESTDIR = BINDIR = $(PREFIX)/bin @@ -8,7 +9,7 @@ CPPFLAGSF= -I ../include CPPFLAGS= CFLAGSF = -W CFLAGS = -Wall -g -O2 -pedantic -LDFLAGSF= -L../src -Wl,-rpath,$(PREFIX)/lib -lSystem +LDFLAGSF= -L../src -L$(OBJDIR). -Wl,-rpath,$(PREFIX)/lib -lSystem RM = rm -f LN = ln -f MKDIR = mkdir -m 0755 -p @@ -17,15 +18,15 @@ INSTALL = install all: $(TARGETS) -configctl_OBJS = configctl.o +configctl_OBJS = $(OBJDIR)configctl.o configctl_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) configctl_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) -configctl: $(configctl_OBJS) - $(CC) -o configctl $(configctl_OBJS) $(configctl_LDFLAGS) +$(OBJDIR)configctl: $(configctl_OBJS) + $(CC) -o $(OBJDIR)configctl $(configctl_OBJS) $(configctl_LDFLAGS) -configctl.o: configctl.c - $(CC) $(configctl_CFLAGS) -c configctl.c +$(OBJDIR)configctl.o: configctl.c + $(CC) $(configctl_CFLAGS) -o $(OBJDIR)configctl.o -c configctl.c clean: $(RM) -- $(configctl_OBJS) @@ -35,7 +36,7 @@ distclean: clean install: $(TARGETS) $(MKDIR) $(DESTDIR)$(BINDIR) - $(INSTALL) -m 0755 configctl $(DESTDIR)$(BINDIR)/configctl + $(INSTALL) -m 0755 $(OBJDIR)configctl $(DESTDIR)$(BINDIR)/configctl uninstall: $(RM) -- $(DESTDIR)$(BINDIR)/configctl diff --git a/tools/project.conf b/tools/project.conf index b72870f..26ce193 100644 --- a/tools/project.conf +++ b/tools/project.conf @@ -3,7 +3,7 @@ cppflags_force=-I ../include cppflags= cflags_force=-W cflags=-Wall -g -O2 -pedantic -ldflags_force=-L../src -Wl,-rpath,$(PREFIX)/lib -lSystem +ldflags_force=-L../src -L$(OBJDIR). -Wl,-rpath,$(PREFIX)/lib -lSystem dist=COPYING,Makefile [configctl]