SRCS= dump_db.h dump_db.c bkup1.c bkup.c dumprest.c rest_db.c rest1.c rest.c
SRCDIR=${SRCTOP}/backup
-CODE= db2bkup.awk db2rest.awk dump_db.h dump_db.dc dumprest.dc \
- nightly.sh report.sh rest_db.dc
+CODE= db2bkup.awk db2rest.awk dump_db.h dump_db.pc dumprest.pc \
+ nightly.sh report.sh rest_db.pc
BOBJS= dump_db.o bkup1.o bkup.o dumprest.o
ROBJS= rest_db.o rest1.o rest.o dumprest.o
sqlrule()
program(mrbackup, ${BOBJS},${MR_LIBDEP}, ${CLIBS} ${SQL_LIB}, ${PROGDIR})
program(mrrestore, ${ROBJS},${MR_LIBDEP}, ${CLIBS} ${SQL_LIB}, ${PROGDIR})
-bkup.dc: ../db/schema.sql db2bkup.awk
- awk -f db2bkup.awk < ../db/schema.sql > bkup.dc
-bkup1.dc: bkup.dc
-rest.dc: ../db/schema.sql db2rest.awk
- awk -f db2rest.awk < ../db/schema.sql > rest.dc
-rest1.dc: rest.dc
+bkup.pc: ../db/schema.sql db2bkup.awk
+ awk -f db2bkup.awk < ../db/schema.sql > bkup.pc
+bkup1.pc: bkup.pc
+rest.pc: ../db/schema.sql db2rest.awk
+ awk -f db2rest.awk < ../db/schema.sql > rest.pc
+rest1.pc: rest.pc
clean::
- $(RM) bkup.dc bkup1.dc rest.dc rest1.dc
+ $(RM) bkup.pc bkup1.pc rest.pc rest1.pc
sqlfile(dump_db)
sqlfile(rest_db)
sqlfile(dumprest)
print "#include \"dump_db.h\"";
print "#define dump_date dump_str\n";
- print "/* This file automatically generated */" > "bkup1.dc";
- print "/* Do not edit */\n" >> "bkup1.dc";
- print "#include <stdio.h>" >> "bkup1.dc";
- print "FILE *open_file();" >> "bkup1.dc";
- print "do_backups(prefix)\n\tchar *prefix;\n{" >> "bkup1.dc";
+ print "/* This file automatically generated */" > "bkup1.pc";
+ print "/* Do not edit */\n" >> "bkup1.pc";
+ print "#include <stdio.h>" >> "bkup1.pc";
+ print "FILE *open_file();" >> "bkup1.pc";
+ print "do_backups(prefix)\n\tchar *prefix;\n{" >> "bkup1.pc";
}
$1=="#" { next; }
/^create/ {
printf "dump_%s(f)\nFILE *f;\n{\n\tEXEC SQL BEGIN DECLARE SECTION;\n", $3;
- printf "\tdump_%s(open_file(prefix, \"%s\"));\n", $3, $3 >> "bkup1.dc";
+ printf "\tdump_%s(open_file(prefix, \"%s\"));\n", $3, $3 >> "bkup1.pc";
tablename = $3;
rangename = substr(tablename, 1, 1);
END {
print "/* All done */";
- print "}" >> "bkup1.dc";
+ print "}" >> "bkup1.pc";
}
print "EXEC SQL INCLUDE sqlca;";
print "void parse_nl(), parse_str(FILE *, char *, int), parse_sep();\n";
- print "/* This file automatically generated */" > "rest1.dc";
- print "/* Do not edit */\n" >> "rest1.dc";
- print "#include <stdio.h>" >> "rest1.dc";
- print "FILE *open_file();" >> "rest1.dc";
- print "do_restores(prefix)\n\tchar *prefix;\n{" >> "rest1.dc";
+ print "/* This file automatically generated */" > "rest1.pc";
+ print "/* Do not edit */\n" >> "rest1.pc";
+ print "#include <stdio.h>" >> "rest1.pc";
+ print "FILE *open_file();" >> "rest1.pc";
+ print "do_restores(prefix)\n\tchar *prefix;\n{" >> "rest1.pc";
}
$1=="#" { next; }
/^create/ {
printf "restore_%s(f)\nFILE *f;\n", $3;
print "{\n\tEXEC SQL BEGIN DECLARE SECTION;";
- printf "\trestore_%s(open_file(prefix, \"%s\"));\n", $3, $3 >> "rest1.dc";
+ printf "\trestore_%s(open_file(prefix, \"%s\"));\n", $3, $3 >> "rest1.pc";
tablename = $3;
rangename = substr(tablename, 1, 1);
END {
print "/* All done */";
- print "}" >> "rest1.dc";
+ print "}" >> "rest1.pc";
}