From: Jean-Marc Pigeon (Delson) Date: Tue, 24 Jun 2025 18:13:50 +0000 (-0400) Subject: Able to produce SQL different library X-Git-Tag: tag-0.10~45 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=a40e17e75b11362870ab9aba664ab2179a7d22ec;p=jmp%2Fmailleur Able to produce SQL different library --- diff --git a/lib/Makefile b/lib/Makefile index a1d460e..6535579 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -27,8 +27,13 @@ OBJS= \ unipos.o uniprc.o unisig.o unitls.o \ subafn.o subrou.o -objs : $(OBJS) - @ ar -cr $(LIBMAIL) $(OBJS) +LIBS= \ + libmar.o libpos.o + +objs : $(OBJS) $(LIBS) + @ ar -cr libmail.a $(OBJS) + @ ar -cr libpos.a libpos.o + @ ar -cr libmar.a libmar.o #-------------------------------------------------------------------- #Dependances @@ -134,6 +139,24 @@ uniprc.h: \ unitls.h: \ subafn.h +libpos.o: subrou.h \ + unipos.h unipos.c + @ $(CC) \ + -DDATABASE=1 \ + -Dwith_postgres \ + -c \ + -g \ + -o $@ unipos.c + +libmar.o: subrou.h \ + unimar.h unimar.c + @ $(CC) \ + -DDATABASE=2 \ + -Dwith_mysql \ + -c \ + -g \ + -o $@ unimar.c + #-------------------------------------------------------------------- toremake: Makefile @@ -143,18 +166,12 @@ toremake: Makefile #-------------------------------------------------------------------- .PHONY: clean #-------------------------------------------------------------------- -#to set the compiled default library -ifeq ($(strip $(DB)),) -DB=0 -endif -#-------------------------------------------------------------------- CC = gcc LD = gcc CFLAGS = -Wall -D_GNU_SOURCE \ - -DDATABASE=$(DB) \ -Dwith_postgres \ -Dwith_mysql \ $(OPTIME) -LIBMAIL = libmail.a +LIBMAIL = libmail.a libmar.a libpos.a PAR = -j`/usr/bin/getconf _NPROCESSORS_ONLN` #-------------------------------------------------------------------- diff --git a/lib/subrou.h b/lib/subrou.h index d79025e..8959798 100644 --- a/lib/subrou.h +++ b/lib/subrou.h @@ -20,7 +20,7 @@ #define ITSOK 0 //to check errno against no error //defining database #define -#define USE_ALLDB 0 //All database type need to be linked +#define USE_NODB 0 //No DB TYPE defined #define USE_POSTGRESQL 1 #define USE_MYSQL 2 diff --git a/lib/unimar.c b/lib/unimar.c index 384b50d..a3013c1 100644 --- a/lib/unimar.c +++ b/lib/unimar.c @@ -16,7 +16,7 @@ #include "unimar.h" //checking if MYSQL database need to compiled -#if DATABASE==USE_MYSQL || DATABSE==USE_ALLDB +#if DATABASE==USE_MYSQL #define DB_MYSQL #endif diff --git a/sql/mailleur.mysql b/sql/mailleur.mysql deleted file mode 100644 index 3dffd8c..0000000 --- a/sql/mailleur.mysql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE emails ( - email TEXT, - space INTEGER - DEFAULT 0, - mxspace INTEGER - DEFAULT 20000 - ); diff --git a/sql/mailleur.postg b/sql/mailleur.postg deleted file mode 100644 index 3dffd8c..0000000 --- a/sql/mailleur.postg +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE emails ( - email TEXT, - space INTEGER - DEFAULT 0, - mxspace INTEGER - DEFAULT 20000 - );