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/
builddir/
packages/
utils/xbps-bin
utils/xbps-cmpver
utils/xbps-digest
utils/xbps-pkgdb
utils/libxbps.so*
bin/xbps-bin
bin/xbps-cmpver
bin/xbps-digest
bin/xbps-pkgdb
*.o
*.so*
*.bak

View file

@ -1,15 +1,25 @@
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
include vars.mk
SUBDIRS = lib bin
.PHONY: all
all:
cd utils && make
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir; \
done
.PHONY: install
install:
install -D xbps-src.sh $(BINDIR)/xbps-src
cd utils && make install
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir install; \
done
uninstall:
-rm -f $(BINDIR)/xbps-*
.PHONY: 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 <libgen.h>
#include "xbps_api.h"
#include <xbps_api.h>
typedef struct repository_info {
const char *index_version;

View file

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

View file

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

View file

@ -30,7 +30,7 @@
#include <errno.h>
#include <limits.h>
#include "xbps_api.h"
#include <xbps_api.h>
typedef struct pkg_data {
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 <prop/proplib.h>
#include "xbps_api.h"
#include <xbps_api.h>
struct callback_args {
const char *string;

View file

@ -41,7 +41,7 @@
#include <inttypes.h>
#include <libgen.h>
#include "xbps_api.h"
#include <xbps_api.h>
/*** 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_REGPKGDB_PATH:=$XBPS_CACHEDIR/regpkgdb.plist}
: ${XBPS_PKGMETADIR:=$XBPS_CACHEDIR/metadata}
: ${XBPS_UTILSDIR:=$XBPS_DISTRIBUTIONDIR/utils}
: ${XBPS_SHUTILSDIR:=$XBPS_UTILSDIR/sh}
: ${XBPS_DIGEST_CMD:=$XBPS_UTILSDIR/xbps-digest}
: ${XBPS_REGPKGDB_CMD:=$XBPS_UTILSDIR/xbps-pkgdb}
: ${XBPS_CMPVER_CMD:=$XBPS_UTILSDIR/xbps-cmpver}
: ${XBPS_SHUTILSDIR:=$XBPS_DISTRIBUTIONDIR/shutils}
: ${XBPS_DIGEST_CMD:=$XBPS_DISTRIBUTIONDIR/bin/xbps-digest}
: ${XBPS_REGPKGDB_CMD:=$XBPS_DISTRIBUTIONDIR/bin/xbps-pkgdb}
: ${XBPS_CMPVER_CMD:=$XBPS_DISTRIBUTIONDIR/bin/xbps-cmpver}
local DDIRS="XBPS_TEMPLATESDIR XBPS_HELPERSDIR XBPS_UTILSDIR \
XBPS_SHUTILSDIR"
local DDIRS="XBPS_TEMPLATESDIR XBPS_HELPERSDIR XBPS_SHUTILSDIR"
for i in ${DDIRS}; do
eval val="\$$i"
[ ! -d "$val" ] && msg_error "cannot find $i, aborting."