From 2be65017c9c3136ffcfa6abe9f9d5f30e237a087 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 26 Nov 2014 09:27:40 +0300
Subject: [PATCH 20/27] Fix rules to use variables.

---
 builds/posix/Makefile.in.examples     | 18 +++++++++---------
 builds/posix/Makefile.in.refDatabases |  8 ++++----
 builds/posix/make.defaults            |  2 +-
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/builds/posix/Makefile.in.examples b/builds/posix/Makefile.in.examples
index 31376494d9..ade180b4fa 100644
--- a/builds/posix/Makefile.in.examples
+++ b/builds/posix/Makefile.in.examples
@@ -117,9 +117,9 @@ $(EXAMPLES_DEST)% : $(EXAMPLES_SRC)%
 
 
 $(EXAMPLES_DEST)/employee.fdb:	$(EXAMPLES_DEST)/empbuild$(EXEC_EXT) $(INPUT_Sources) $(EXAMPLES_DEST)/isql$(EXEC_EXT)
-	-$(RM) employee.fdb
-	./empbuild employee.fdb
-	-$(CHMOD_6) employee.fdb
+	-$(RM) $(EXAMPLES_DEST)/employee.fdb
+	$(EXAMPLES_DEST)/empbuild$(EXEC_EXT) $(EXAMPLES_DEST)/employee.fdb
+	-$(CHMOD_6) $(EXAMPLES_DEST)/employee.fdb
 
 # To get past the fact isql is called from the programs, we create a local link
 # to the static one in this directory
@@ -134,16 +134,16 @@ $(EXAMPLES_DEST)/empbuild.c:	$(EXAMPLES_DEST)/empbuild.fdb $(EXAMPLES_DEST)/empb
 
 $(EXAMPLES_DEST)/empbuild.fdb : $(EXAMPLES_DEST)/empddl.sql $(EXAMPLES_DEST)/empbld.sql $(EXAMPLES_DEST)/isql$(EXEC_EXT)
 	-$(RM) $(EXAMPLES_DEST)/empbuild.fdb
-	$(EXAMPLES_DEST)/isql$(EXEC_EXT) -i empbld.sql
+	$(EXAMPLES_DEST)/isql$(EXEC_EXT) -i $(EXAMPLES_DEST)/empbld.sql
 
 # The chain for intlemp.fdb is the same a script file to create an empty database
 # to allow a .e program to be compiled, to then create and populate with data
 # the intlemp.fdb database.
 
 $(EXAMPLES_DEST)/intlemp.fdb:	$(EXAMPLES_DEST)/intlbld$(EXEC_EXT) $(INTL_Sources) $(EXAMPLES_DEST)/isql$(EXEC_EXT)
-	-$(RM) intlemp.fdb
-	./intlbld intlemp.fdb
-	-$(CHMOD_6) intlemp.fdb
+	-$(RM) $(EXAMPLES_DEST)/intlemp.fdb
+	$(EXAMPLES_DEST)/intlbld$(EXEC_EXT) $(EXAMPLES_DEST)/intlemp.fdb
+	-$(CHMOD_6) $(EXAMPLES_DEST)/intlemp.fdb
 
 $(EXAMPLES_DEST)/intlbld$(EXEC_EXT): $(INTLBLD_Objects) $(COMMON_Objects) $(LIBFBSTATIC_A) 
 	$(EXE_LINK) $(LINK_OPTS) $(INTLBLD_Objects) $(COMMON_Objects) -o $@ -L$(LIB) -lfbstatic $(LINK_LIBS) $(ICU_LIBS)
@@ -151,8 +151,8 @@ $(EXAMPLES_DEST)/intlbld$(EXEC_EXT): $(INTLBLD_Objects) $(COMMON_Objects) $(LIBF
 $(EXAMPLES_DEST)/intlbld.c:	$(EXAMPLES_DEST)/intlbuild.fdb $(EXAMPLES_DEST)/intlbld.e
 
 $(EXAMPLES_DEST)/intlbuild.fdb : $(EXAMPLES_DEST)/intlddl.sql $(EXAMPLES_DEST)/intlbld.sql $(EXAMPLES_DEST)/isql$(EXEC_EXT)
-	-$(RM) intlbuild.fdb
-	$(EXAMPLES_DEST)/isql$(EXEC_EXT) -i intlbld.sql
+	-$(RM) $(EXAMPLES_DEST)/intlbuild.fdb
+	$(EXAMPLES_DEST)/isql$(EXEC_EXT) -i $(EXAMPLES_DEST)/intlbld.sql
 
 
 $(EXAMPLES_DEST)/%.sql: $(EXAMPLES_SRC)/empbuild/%.sql
diff --git a/builds/posix/Makefile.in.refDatabases b/builds/posix/Makefile.in.refDatabases
index c1b61a64fc..68016ccebc 100644
--- a/builds/posix/Makefile.in.refDatabases
+++ b/builds/posix/Makefile.in.refDatabases
@@ -65,7 +65,7 @@ empty_db : empty.fdb yachts.lnk
 empty.fdb : $(CREATE_DB)
 	$(MAKE) -f $(GEN_ROOT)/Makefile.static.createdb
 	-$(RM) $@
-	$(BIN)/create_db $@
+	$(CREATE_DB) $@
 	$(TOUCH) $@
 	$(CHMOD) 444 $@
 
@@ -99,7 +99,7 @@ help.fdb:	$(FIREBIRD)/help/help.fdb
 	$(LN) -f $^ $@
 
 $(FIREBIRD)/help/help.fdb:	$(BLD_ROOT)/misc/help.gbak
-	$(BIN)/gbak_static -MODE read_only -R $< $@
+	$(GBAK_STATIC) -MODE read_only -R $< $@
 	$(TOUCH) $@
 	$(CHMOD) 444 $@
 
@@ -114,7 +114,7 @@ security2.fdb:	$(SRC_ROOT)/dbs/security.sql
 	$(CHMOD) a=rw $@
 
 metadata.fdb:	$(BLD_ROOT)/misc/metadata.gbak
-	$(BIN)/gbak_static -MODE read_only -R $< $@
+	$(GBAK_STATIC) -MODE read_only -R $< $@
 	$(TOUCH) $@
 	$(CHMOD) 444 $@
 
@@ -122,7 +122,7 @@ metadata.fdb:	$(BLD_ROOT)/misc/metadata.gbak
 # since it ensures the data is valid.
 
 metadata.fdb.x:	$(SRC_ROOT)/misc/metadata.sql
-	$(BIN)/isql -i $<
+	$(ISQL) -i $<
 	$(TOUCH) $@
 	$(CHMOD) 444 $@
 
diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults
index c2c2ffe343..2ad21f93f5 100755
--- a/builds/posix/make.defaults
+++ b/builds/posix/make.defaults
@@ -183,7 +183,7 @@ SHRLIB_FOREIGN_EXT=	$(SHRLIB_EXT)
 
 vpath %.so $(LIB)
 vpath %.a $(LIB)
-vpath %.dll $(LIB)
+vpath %.dll $(BIN)
 
 #_____________________________________________________________________________
 
-- 
2.13.0

