Also install the header for libDatabase

This commit is contained in:
Pierre Pronchery 2012-10-29 21:36:18 +01:00
parent c3201896e8
commit 02aa98967b
13 changed files with 112 additions and 19 deletions

View File

@ -1,6 +1,6 @@
PACKAGE = libDatabase
VERSION = 0.0.0
SUBDIRS = data src
SUBDIRS = data include src
RM ?= rm -f
LN ?= ln -f
TAR ?= tar -czvf
@ -25,6 +25,12 @@ dist:
$(PACKAGE)-$(VERSION)/data/libDatabase.pc.in \
$(PACKAGE)-$(VERSION)/data/pkgconfig.sh \
$(PACKAGE)-$(VERSION)/data/project.conf \
$(PACKAGE)-$(VERSION)/include/Database.h \
$(PACKAGE)-$(VERSION)/include/Makefile \
$(PACKAGE)-$(VERSION)/include/project.conf \
$(PACKAGE)-$(VERSION)/include/Database/database.h \
$(PACKAGE)-$(VERSION)/include/Database/Makefile \
$(PACKAGE)-$(VERSION)/include/Database/project.conf \
$(PACKAGE)-$(VERSION)/src/database.c \
$(PACKAGE)-$(VERSION)/src/Makefile \
$(PACKAGE)-$(VERSION)/src/project.conf \
@ -34,7 +40,6 @@ dist:
$(PACKAGE)-$(VERSION)/src/engines/sqlite3.c \
$(PACKAGE)-$(VERSION)/src/engines/template.c \
$(PACKAGE)-$(VERSION)/src/engines/Makefile \
$(PACKAGE)-$(VERSION)/src/engines/database.h \
$(PACKAGE)-$(VERSION)/src/engines/project.conf \
$(PACKAGE)-$(VERSION)/Makefile \
$(PACKAGE)-$(VERSION)/config.h \

24
include/Database.h Normal file
View File

@ -0,0 +1,24 @@
/* $Id$ */
/* Copyright (c) 2012 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Database libDatabase */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef LIBDATABASE_DATABASE_H
# define LIBDATABASE_DATABASE_H
# include "Database/database.h"
#endif /* !LIBDATABASE_DATABASE_H */

23
include/Database/Makefile Normal file
View File

@ -0,0 +1,23 @@
PREFIX = /usr/local
DESTDIR =
RM ?= rm -f
LN ?= ln -f
MKDIR ?= mkdir -p
INSTALL ?= install
INCLUDEDIR= $(PREFIX)/include
all:
clean:
distclean: clean
install:
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/Database
$(INSTALL) -m 0644 -- database.h $(DESTDIR)$(INCLUDEDIR)/Database/database.h
uninstall:
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/Database/database.h
.PHONY: all clean distclean install uninstall

View File

@ -0,0 +1,5 @@
includes=database.h
dist=Makefile
[database.h]
install=$(INCLUDEDIR)/Database

31
include/Makefile Normal file
View File

@ -0,0 +1,31 @@
SUBDIRS = Database
PREFIX = /usr/local
DESTDIR =
RM ?= rm -f
LN ?= ln -f
MKDIR ?= mkdir -p
INSTALL ?= install
INCLUDEDIR= $(PREFIX)/include
all: subdirs
subdirs:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE)) || exit; done
clean:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done
distclean:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean) || exit; done
install:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)
$(INSTALL) -m 0644 -- Database.h $(DESTDIR)$(INCLUDEDIR)/Database.h
uninstall:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/Database.h
.PHONY: all subdirs clean distclean install uninstall

3
include/project.conf Normal file
View File

@ -0,0 +1,3 @@
subdirs=Database
includes=Database.h
dist=Makefile

View File

@ -2,5 +2,5 @@ package=libDatabase
version=0.0.0
config=h,sh
subdirs=data,src
subdirs=data,include,src
dist=Makefile,config.h

View File

@ -4,7 +4,7 @@ PREFIX = /usr/local
DESTDIR =
LIBDIR = $(PREFIX)/lib
CC ?= cc
CPPFLAGSF?=
CPPFLAGSF= -I ../include/Database
CPPFLAGS?=
CFLAGSF = -W -fPIC
CFLAGS = -Wall -g -O2 -pedantic
@ -35,7 +35,7 @@ libDatabase.so.0.0 libDatabase.so.0 libDatabase.so: $(libDatabase_OBJS)
$(LN) -s -- libDatabase.so.0.0 libDatabase.so.0
$(LN) -s -- libDatabase.so.0.0 libDatabase.so
database.o: database.c engines/database.h
database.o: database.c ../include/Database/database.h
$(CC) $(libDatabase_CFLAGS) -c database.c
clean:

View File

@ -17,7 +17,7 @@
#include <string.h>
#include <System.h>
#include "engines/database.h"
#include "database.h"
#include "../config.h"

View File

@ -3,7 +3,7 @@ PREFIX = /usr/local
DESTDIR =
LIBDIR = $(PREFIX)/lib
CC ?= cc
CPPFLAGSF?=
CPPFLAGSF= -I ../../include/Database
CPPFLAGS?=
CFLAGSF = -W -fPIC
CFLAGS = -Wall -g -O2 -pedantic
@ -53,19 +53,19 @@ template_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
template.so: $(template_OBJS)
$(CCSHARED) -o template.so $(template_OBJS) $(template_LDFLAGS)
pdo.o: pdo.c database.h ../../config.h
pdo.o: pdo.c ../../include/Database/database.h ../../config.h
$(CC) $(pdo_CFLAGS) -c pdo.c
pgsql.o: pgsql.c database.h
pgsql.o: pgsql.c ../../include/Database/database.h
$(CC) $(pgsql_CFLAGS) -c pgsql.c
sqlite2.o: sqlite2.c database.h
sqlite2.o: sqlite2.c ../../include/Database/database.h
$(CC) $(sqlite2_CFLAGS) -c sqlite2.c
sqlite3.o: sqlite3.c database.h
sqlite3.o: sqlite3.c ../../include/Database/database.h
$(CC) $(sqlite3_CFLAGS) -c sqlite3.c
template.o: template.c database.h
template.o: template.c ../../include/Database/database.h
$(CC) $(template_CFLAGS) -c template.c
clean:

View File

@ -1,7 +1,8 @@
targets=pdo,pgsql,sqlite2,sqlite3,template
cppflags_force=-I ../../include/Database
cflags_force=-W -fPIC
cflags=-Wall -g -O2 -pedantic
dist=Makefile,database.h
dist=Makefile
[pdo]
type=plugin
@ -9,7 +10,7 @@ sources=pdo.c
install=$(LIBDIR)/Database/engine
[pdo.c]
depends=database.h,../../config.h
depends=../../include/Database/database.h,../../config.h
[pgsql]
type=plugin
@ -19,7 +20,7 @@ sources=pgsql.c
install=$(LIBDIR)/Database/engine
[pgsql.c]
depends=database.h
depends=../../include/Database/database.h
[sqlite2]
type=plugin
@ -29,7 +30,7 @@ sources=sqlite2.c
install=$(LIBDIR)/Database/engine
[sqlite2.c]
depends=database.h
depends=../../include/Database/database.h
[sqlite3]
type=plugin
@ -39,11 +40,11 @@ sources=sqlite3.c
install=$(LIBDIR)/Database/engine
[sqlite3.c]
depends=database.h
depends=../../include/Database/database.h
[template]
type=plugin
sources=template.c
[template.c]
depends=database.h
depends=../../include/Database/database.h

View File

@ -1,5 +1,6 @@
subdirs=engines
targets=libDatabase
cppflags_force=-I ../include/Database
cflags_force=-W -fPIC
cflags=-Wall -g -O2 -pedantic
dist=Makefile
@ -9,4 +10,4 @@ type=library
sources=database.c
[database.c]
depends=engines/database.h
depends=../include/Database/database.h