Reorganize the tree splitting stuff on its own dir.

--HG--
extra : convert_revision : 87473fb499c42deaf0285f5559dc1cd8d67ab436
This commit is contained in:
Juan RP 2008-12-21 23:57:02 +01:00
parent 9019592d9d
commit e7cf222ac9
35 changed files with 98 additions and 69 deletions

10
.gitignore vendored
View File

@ -4,10 +4,10 @@ destdir/
srcdistdir/ srcdistdir/
builddir/ builddir/
packages/ packages/
utils/xbps-bin bin/xbps-bin
utils/xbps-cmpver bin/xbps-cmpver
utils/xbps-digest bin/xbps-digest
utils/xbps-pkgdb bin/xbps-pkgdb
utils/libxbps.so*
*.o *.o
*.so*
*.bak *.bak

View File

@ -1,15 +1,25 @@
PREFIX ?= /usr/local include vars.mk
BINDIR ?= $(PREFIX)/bin
SUBDIRS = lib bin
.PHONY: all
all: all:
cd utils && make for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir; \
done
.PHONY: install
install: install:
install -D xbps-src.sh $(BINDIR)/xbps-src install -D xbps-src.sh $(BINDIR)/xbps-src
cd utils && make install for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir install; \
done
uninstall: uninstall:
-rm -f $(BINDIR)/xbps-* -rm -f $(BINDIR)/xbps-*
.PHONY: clean
clean: clean:
cd utils && make clean for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir clean; \
done

33
bin/Makefile Normal file
View File

@ -0,0 +1,33 @@
include ../vars.mk
EXTRA_CFLAGS = -funroll-all-loops -ftree-loop-linear
LDFLAGS += -L../lib -Wl,-rpath $$(pwd)/../lib -lxbps
BINS = xbps-bin xbps-cmpver xbps-digest xbps-pkgdb
all: $(BINS)
.PHONY: all
xbps-bin: xbps-bin.o
$(CC) $(LDFLAGS) $^ -o $@
xbps-cmpver: xbps-cmpver.o
$(CC) $^ -o $@
xbps-digest: xbps-digest.o
$(CC) $(EXTRA_CFLAGS) $(LDFLAGS) $^ -o $@
xbps-pkgdb: xbps-pkgdb.o
$(CC) $(LDFLAGS) $^ -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BINS)
clean-objs:
-rm -f *.o
install: $(BINS)
install -D $(BINS)

View File

@ -31,7 +31,7 @@
#include <limits.h> #include <limits.h>
#include <libgen.h> #include <libgen.h>
#include "xbps_api.h" #include <xbps_api.h>
typedef struct repository_info { typedef struct repository_info {
const char *index_version; const char *index_version;

View File

@ -5,7 +5,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "xbps_api.h" #include <xbps_api.h>
static int chkchr(const char *ch) static int chkchr(const char *ch)
{ {

View File

@ -35,7 +35,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <libgen.h> #include <libgen.h>
#include "xbps_api.h" #include <xbps_api.h>
static void static void
usage(void) usage(void)

View File

@ -30,7 +30,7 @@
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include "xbps_api.h" #include <xbps_api.h>
typedef struct pkg_data { typedef struct pkg_data {
const char *pkgname; const char *pkgname;

26
lib/Makefile Normal file
View File

@ -0,0 +1,26 @@
include ../vars.mk
# The shared library.
MAJOR = 0
MINOR = 0
MICRO = 0
LIBXBPS_SO = $(LIBXBPS).$(MAJOR).$(MINOR).$(MICRO)
LIBXBPS = libxbps.so
LIBXBPS_LDFLAGS = -lprop -shared -Wl,-soname,$(LIBXBPS).$(MAJOR)
all: $(LIBXBPS)
.PHONY: all
$(LIBXBPS): sha256.o plist.o
$(CC) $(LIBXBPS_LDFLAGS) $^ -o $(LIBXBPS_SO)
-ln -sf $(LIBXBPS_SO) $(LIBXBPS).$(MAJOR)
-ln -sf $(LIBXBPS_SO) $(LIBXBPS)
.PHONY: clean
clean: clean-lib clean-objs
clean-lib:
-rm -f $(LIBXBPS)*
clean-objs:
-rm -f *.o

View File

@ -31,7 +31,7 @@
#include <limits.h> #include <limits.h>
#include <prop/proplib.h> #include <prop/proplib.h>
#include "xbps_api.h" #include <xbps_api.h>
struct callback_args { struct callback_args {
const char *string; const char *string;

View File

@ -41,7 +41,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <libgen.h> #include <libgen.h>
#include "xbps_api.h" #include <xbps_api.h>
/*** SHA-256 Machine Architecture Definitions *****************/ /*** SHA-256 Machine Architecture Definitions *****************/

View File

@ -1,46 +0,0 @@
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
CFLAGS += -Wall -Werror -O3 -I$(PREFIX)/include
CFLAGS += -funroll-all-loops -ftree-loop-linear -fPIC -DPIC
LDFLAGS += -L $$(pwd) -Wl,-rpath $$(pwd) -lxbps
BINS ?= xbps-bin xbps-cmpver xbps-digest xbps-pkgdb
# The shared library.
MAJOR = 0
MINOR = 0
MICRO = 0
LIBXBPS_SO = $(LIBXBPS).$(MAJOR).$(MINOR).$(MICRO)
LIBXBPS = libxbps.so
LIBXBPS_LDFLAGS = -lprop -shared -Wl,-soname,$(LIBXBPS).$(MAJOR)
all: $(LIBXBPS) $(BINS)
.PHONY: all
$(LIBXBPS): sha256.o plist.o
$(CC) $(LIBXBPS_LDFLAGS) $^ -o $(LIBXBPS_SO)
-ln -sf $(LIBXBPS_SO) $(LIBXBPS).$(MAJOR)
-ln -sf $(LIBXBPS_SO) $(LIBXBPS)
xbps-bin: xbps-bin.o
$(CC) $(LDFLAGS) $^ -o $@
xbps-cmpver: xbps-cmpver.o
$(CC) $^ -o $@
xbps-digest: xbps-digest.o
$(CC) $(LDFLAGS) $^ -o $@
xbps-pkgdb: xbps-pkgdb.o
$(CC) $(LDFLAGS) $^ -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BINS) $(LIBXBPS)*
clean-objs:
-rm -f *.o $(LIBXBPS)*
install: $(BINS)
install -D $(BINS) $(BINDIR)

8
vars.mk Normal file
View File

@ -0,0 +1,8 @@
# Common variables.
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/lib
CPPFLAGS += -I../include
CFLAGS += -O2 -Wall -Werror -fPIC -DPIC

View File

@ -102,14 +102,12 @@ set_defvars()
: ${XBPS_CACHEDIR:=$XBPS_MASTERDIR/var/cache/xbps} : ${XBPS_CACHEDIR:=$XBPS_MASTERDIR/var/cache/xbps}
: ${XBPS_REGPKGDB_PATH:=$XBPS_CACHEDIR/regpkgdb.plist} : ${XBPS_REGPKGDB_PATH:=$XBPS_CACHEDIR/regpkgdb.plist}
: ${XBPS_PKGMETADIR:=$XBPS_CACHEDIR/metadata} : ${XBPS_PKGMETADIR:=$XBPS_CACHEDIR/metadata}
: ${XBPS_UTILSDIR:=$XBPS_DISTRIBUTIONDIR/utils} : ${XBPS_SHUTILSDIR:=$XBPS_DISTRIBUTIONDIR/shutils}
: ${XBPS_SHUTILSDIR:=$XBPS_UTILSDIR/sh} : ${XBPS_DIGEST_CMD:=$XBPS_DISTRIBUTIONDIR/bin/xbps-digest}
: ${XBPS_DIGEST_CMD:=$XBPS_UTILSDIR/xbps-digest} : ${XBPS_REGPKGDB_CMD:=$XBPS_DISTRIBUTIONDIR/bin/xbps-pkgdb}
: ${XBPS_REGPKGDB_CMD:=$XBPS_UTILSDIR/xbps-pkgdb} : ${XBPS_CMPVER_CMD:=$XBPS_DISTRIBUTIONDIR/bin/xbps-cmpver}
: ${XBPS_CMPVER_CMD:=$XBPS_UTILSDIR/xbps-cmpver}
local DDIRS="XBPS_TEMPLATESDIR XBPS_HELPERSDIR XBPS_UTILSDIR \ local DDIRS="XBPS_TEMPLATESDIR XBPS_HELPERSDIR XBPS_SHUTILSDIR"
XBPS_SHUTILSDIR"
for i in ${DDIRS}; do for i in ${DDIRS}; do
eval val="\$$i" eval val="\$$i"
[ ! -d "$val" ] && msg_error "cannot find $i, aborting." [ ! -d "$val" ] && msg_error "cannot find $i, aborting."