.include <../Config> # Self compatible drivers - if they are compiled they will be linked # statically into ck_static. # Example of incompatible drivers - msql and msql2 # D_COMPAT= msql2 mysql null # Dynamicaly generated list of driver's libraries # D_LIBS = `for drv in \`(cd ../drivers; ./configure list; for c in $(D_COMPAT); do echo $$c; done) \ |sort|uniq -d\`; \ do \ if [ -f ../drivers/$$drv/.required ]; then \ awk -F= '/^DC_LIBPATH/ || /^DC_LIBRARIES/ {print $$2}' \ ../drivers/$$drv/.config; \ fi; \ done` C01 = ck_static C01_S = ck.C C01_O = ck_static.o C01_L = ../src/lib$(PROJECT).a C01_F = -DSTATIC_DRIVERS C01_E = $(D_LIBS) C02 = ck_dynamic C02_S = ck.C C02_O = ck_dynamic.o C02_L = ../src/lib$(PROJECT).a C02_F = -DDYNAMIC_DRIVERS C02_E = C03 = ck_c C03_S = ck_c.c C03_O = ck_c.o C03_L = ../src/lib$(PROJECT).a C04 = query C04_S = query.C C04_O = query.o C04_L = ../src/lib$(PROJECT).a CPRG = $(C01) $(C02) $(C03) $(C04) $(C05) CSRC = $(C03_S) $(C04_S) $(C05_S) COBJ = $(C01_O) $(C02_O) $(C03_O) $(C04_O) $(C05_O) FILELIST= Makefile ck.C.proto $(CSRC) $(SHSRC) $(DSRC) default: all .include <../MakeRules> all: .all install: .install dist: .dist clean: .clean rm -f ck.C depend: .depend $(C01_O): $(C01_S) $(CXX) $(CFLAGS) $(C01_F) -o $@ -c $> $(C02_O): $(C01_S) $(CXX) $(CFLAGS) $(C02_F) -o $@ -c $> # Producing ck.C from ck.C.proto by replacing @DRIVER@ with a list of # statically included drivers # ck.C: ck.C.proto Makefile list=`(cd ../drivers; ./configure list; for c in $(D_COMPAT); do echo $$c; done)\ |sort|uniq -d`; \ echo $$list; \ if [ "x$$list" != "x" ]; then \ for i in $$list; do if [ -f ../drivers/$$i/.required -a "x$$i" != "msql" ]; then \ cmd="$${cmd}FastDriver($$i);"; \ fi; done; \ sed "s/@DRIVERS@/$$cmd/" ck.C.proto > $@; \ fi