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
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
#--------------------------------------------------------------------
.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`
#--------------------------------------------------------------------
#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