+ if (retval)
+ goto cleanup;
+
+ if (vec_size(items)) {
+ if (!opts_pp_only) {
+ con_out("Mode: %s\n", (progs_src ? "progs.src" : "manual"));
+ con_out("There are %lu items to compile:\n", (unsigned long)vec_size(items));
+ }
+ for (itr = 0; itr < vec_size(items); ++itr) {
+ if (!opts_pp_only) {
+ con_out(" item: %s (%s)\n",
+ items[itr].filename,
+ ( (items[itr].type == TYPE_QC ? "qc" :
+ (items[itr].type == TYPE_ASM ? "asm" :
+ (items[itr].type == TYPE_SRC ? "progs.src" :
+ ("unknown"))))));
+ }
+
+ if (opts_pp_only) {
+ if (!ftepp_preprocess_file(items[itr].filename)) {
+ retval = 1;
+ goto cleanup;
+ }
+ }
+ else if (!parser_compile_file(items[itr].filename)) {
+ retval = 1;
+ goto cleanup;
+ }
+
+ if (progs_src) {
+ mem_d(items[itr].filename);
+ items[itr].filename = NULL;
+ }
+ }
+
+ ftepp_finish();
+ if (!opts_pp_only) {
+ if (!parser_finish(opts_output)) {
+ retval = 1;
+ goto cleanup;
+ }
+ }
+ }
+