Commit b36a2815 authored by Steven Arnow's avatar Steven Arnow

Moved dbp-common into a shared library

parent ab1e1a97
......@@ -20,8 +20,8 @@ all:
@echo " [INIT] build/include/dbpmgr"
@$(MKDIR) build/include
@$(MKDIR) build/include/dbpmgr
@echo " [ CD ] dbp-common/"
+@make -C dbp-common/
@echo " [ CD ] libdbpbase/"
+@make -C libdbpbase/
@echo " [ CD ] libdbpmgr/"
+@make -C libdbpmgr/
@echo " [ CD ] dbpd/"
......@@ -50,8 +50,8 @@ all:
clean:
@echo " [ RM ] build/"
+@$(RM) build/
@echo " [ CD ] dbp-common/"
+@make -C dbp-common/ clean
@echo " [ CD ] libdbpbase/"
+@make -C libdbpbase/ clean
@echo " [ CD ] libdbpmgr/"
+@make -C libdbpmgr/ clean
@echo " [ CD ] dbpd/"
......@@ -100,5 +100,6 @@ install:
install -m 755 $(STRIP_FLAG) -t "$(PREFIX)/usr/bin/" "$(TOPDIR)/build/bin/dbp-run-path"
install -d "$(PREFIX)/usr/lib"
install -m 644 $(STRIP_FLAG) -t "$(PREFIX)/usr/lib/" "$(TOPDIR)/build/lib/libdbpmgr.so"
install -m 644 $(STRIP_FLAG) -t "$(PREFIX)/usr/lib/" "$(TOPDIR)/build/lib/libdbpbase.so"
install -d "$(PREFIX)/usr/include/dbpmgr"
install -m 644 -t "$(PREFIX)/usr/include/dbpmgr" $(TOPDIR)/build/include/dbpmgr/*.h
......@@ -5,11 +5,11 @@
NAME = dbp
#Uncomment to build dbp-run without dpkg dependency checking
#BUILD_DPKG = NO
DAEMONBIN = "$(TOPDIR)/build/bin/$(NAME)d"
LIBBINFILE = "lib$(NAME)mgr.so"
LIBBIN = "$(TOPDIR)/build/lib/$(LIBBINFILE)"
LIBBASEFILE = "lib$(NAME)base.so"
LIBBASE = "$(TOPDIR)/build/lib/$(LIBBASEFILE)"
RUNNERBIN = "$(TOPDIR)/build/bin/$(NAME)-run-old"
CONFIGBIN = "$(TOPDIR)/build/bin/$(NAME)-cfg"
METABIN = "$(TOPDIR)/build/bin/$(NAME)-meta"
......@@ -17,13 +17,13 @@ CMDBIN = "$(TOPDIR)/build/bin/$(NAME)-cmd"
DESKTOPBIN = "$(TOPDIR)/build/bin/$(NAME)-desktopd"
THUMBBIN = "$(TOPDIR)/build/bin/$(NAME)-thumbnailer"
LIB = "$(TOPDIR)/dbp-common/dbp-common.a"
LIBINC = "-I$(TOPDIR)/dbp-common" "-I$(TOPDIR)/build/include"
LIBINC = "-I$(TOPDIR)/libdbpbase" "-I$(TOPDIR)/build/include"
LDPATH += "-L$(TOPDIR)/build/lib"
#DBGFLAGS = -O0 -g -D__DEBUG__
DBGFLAGS = -O3 -g
CFLAGS += -Wall -Wextra -D_XOPEN_SOURCE=700 -std=c99 $(INCS) $(DBGFLAGS)
LDFLAGS += $(LIB) -larchive -lpthread
LDFLAGS += -larchive -lpthread
RM = rm -fR
MKDIR = mkdir -p
CP = cp
......
......@@ -3,11 +3,12 @@ include $(TOPDIR)/config.mk
SRCFILES = $(wildcard *.c)
OBJFILES = $(SRCFILES:.c=.o)
LDFLAGS += -ldbpbase
.PHONY: all clean
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(CONFIGBIN)"
@$(CC) -o $(CONFIGBIN) $(OBJFILES) $(LIB) $(LDFLAGS)
@$(CC) -o $(CONFIGBIN) $(OBJFILES) $(LDPATH) $(LDFLAGS)
@echo "Done."
@echo
......
......@@ -7,7 +7,7 @@ OBJFILES = $(SRCFILES:.c=.o)
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(CMDBIN)"
@$(CC) $(LDPATH) -o $(CMDBIN) $(OBJFILES) $(LIB) $(LDFLAGS) -ldbpmgr
@$(CC) $(LDPATH) -o $(CMDBIN) $(OBJFILES) $(LDFLAGS) -ldbpbase -ldbpmgr
@echo "Done."
@echo
......
......@@ -7,6 +7,7 @@
#include <locale.h>
#define _(STRING) gettext(STRING)
FILE *dbp_error_log = NULL;
struct FunctionLookup {
char *name;
void (*func)(int argc, char **argv);
......@@ -171,6 +172,7 @@ static struct FunctionLookup lookup[] = {
int main(int argc, char **argv) {
int i;
dbp_error_log = stderr;
setlocale(LC_ALL, "");
textdomain("dbp-run");
......
......@@ -8,7 +8,7 @@ CFLAGS += -D_GNU_SOURCE
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(DESKTOPBIN)"
@$(CC) $(LDPATH) -o $(DESKTOPBIN) $(OBJFILES) $(LIB) $(LDFLAGS) -ldbpmgr
@$(CC) $(LDPATH) -o $(DESKTOPBIN) $(OBJFILES) $(LDFLAGS) -ldbpbase -ldbpmgr
@echo "Done."
@echo
......
......@@ -3,11 +3,12 @@ include $(TOPDIR)/config.mk
SRCFILES = $(wildcard *.c)
OBJFILES = $(SRCFILES:.c=.o)
LDFLAGS += -ldbpbase
.PHONY: all clean
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(METABIN)"
@$(CC) -o $(METABIN) $(OBJFILES) $(LIB) $(LDFLAGS)
@$(CC) -o $(METABIN) $(OBJFILES) $(LDPATH) $(LDFLAGS)
@echo "Done."
@echo
......
VALAC = valac
VALAPKG = --pkg=gio-2.0 --target-glib 2.32 --pkg glib-2.0 --pkg=gtk+-3.0 --pkg=posix --pkg=dbp
VALAFLAGS = --vapidir=./common -X -I../dbp-common -X -I../build/include --thread -X -DGETTEXT_PACKAGE=\"dbp-run\" -X -L../build/lib
VALASTATICLIBS = -X ../dbp-common/dbp-common.a
VALAFLAGS = --vapidir=./common -X -I../libdbpbase -X -I../build/include --thread -X -DGETTEXT_PACKAGE=\"dbp-run\" -X -L../build/lib
DEPCHECKSRC = dep-check/dep-check.vala
LIBS = -X -larchive -X -ldbpmgr
LIBS = -X -larchive -X -ldbpmgr -X -ldbpbase
BINPATH = ../build/bin
......
......@@ -4,12 +4,12 @@ include $(TOPDIR)/config.mk
SRCFILES = $(wildcard *.c)
OBJFILES = $(SRCFILES:.c=.o)
CFLAGS += `pkg-config glib-2.0 --cflags gio-unix-2.0`
LDFLAGS += `pkg-config glib-2.0 --libs gio-unix-2.0`
LDFLAGS += `pkg-config glib-2.0 --libs gio-unix-2.0` -ldbpbase
.PHONY: all clean
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(DAEMONBIN)"
@$(CC) -o $(DAEMONBIN) $(OBJFILES) $(LIB) $(LDFLAGS)
@$(CC) -o $(DAEMONBIN) $(OBJFILES) -ldbpbase $(LDPATH) $(LDFLAGS)
@echo "Done."
@echo
......
......@@ -3,11 +3,13 @@ include $(TOPDIR)/config.mk
SRCFILES = $(wildcard *.c)
OBJFILES = $(SRCFILES:.c=.o)
CFLAGS += -shared -fPIC
LDFLAGS += -Wl,-soname,$(LIBBASEFILE)
.PHONY: all clean
all: $(OBJFILES) $(DEPENDS)
@echo " [ AR ] $(LIB)"
@$(AR) -cr $(LIB) $(OBJFILES)
@echo " [ LD ] $(LIBBASE)"
@$(CC) $(CFLAGS) -o $(LIBBASE) $(OBJFILES) $(LDFLAGS)
@echo "Done."
@echo
......@@ -21,7 +23,7 @@ clean:
@echo
%.o: %.c %.h
@echo " [ CC ] dbp-common/$<"
@echo " [ CC ] libdbpbase/$<"
@$(CC) $(CFLAGS) -c -o $@ $<
......@@ -3,13 +3,13 @@ include $(TOPDIR)/config.mk
SRCFILES = $(wildcard *.c)
OBJFILES = $(SRCFILES:.c=.o)
CFLAGS += `pkg-config glib-2.0 --cflags gio-unix-2.0` -shared -fPIC -I$(TOPDIR)/dbp-common
LDFLAGS += `pkg-config glib-2.0 --libs gio-unix-2.0` -Wl,-soname,$(LIBBINFILE)
CFLAGS += `pkg-config glib-2.0 --cflags gio-unix-2.0` -shared -fPIC -I$(TOPDIR)/libdbpbase
LDFLAGS += `pkg-config glib-2.0 --libs gio-unix-2.0` -Wl,-soname,$(LIBBINFILE) -ldbpbase
.PHONY: all clean
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(LIBBIN)"
@$(CC) $(CFLAGS) -o $(LIBBIN) $(OBJFILES) $(LIB) $(LDFLAGS)
@$(CC) $(CFLAGS) -o $(LIBBIN) $(LDPATH) $(OBJFILES) $(LDFLAGS)
@echo " [COPY] Headers into build directory"
@$(CP) *.h $(TOPDIR)/build/include/dbpmgr/
@echo "Done."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment