@@ -261,7 +261,9 @@ int cb_depend_output_only = 0;
261261int cb_depend_add_phony = 0 ;
262262int cb_depend_keep_missing = 0 ;
263263int cb_depend_target_auto = 0 ;
264+ #ifdef EXPERIMENTAL_COPYBOOK_DEPS_OPTION
264265int cb_flag_copybook_deps = 0 ;
266+ #endif
265267
266268/* set by option -fttitle=<title> */
267269char * cb_listing_with_title = NULL ;
@@ -634,7 +636,9 @@ static const struct option long_options[] = {
634636 {"MP" , CB_NO_ARG , NULL , CB_FLAG_GETOPT_DEPEND_ADD_PHONY },
635637 {"MG" , CB_NO_ARG , NULL , CB_FLAG_GETOPT_DEPEND_KEEP_MISSING },
636638 {"MD" , CB_NO_ARG , NULL , CB_FLAG_GETOPT_DEPEND_ON_THE_SIDE },
639+ #ifdef EXPERIMENTAL_COPYBOOK_DEPS_OPTION
637640 {"fcopybook-deps" , CB_NO_ARG , & cb_flag_copybook_deps , 1 },
641+ #endif
638642 {"gentable" , CB_RQ_ARG , NULL , CB_FLAG_GETOPT_GENTABLE },
639643 {"coverage" , CB_NO_ARG , & cb_coverage_enabled , 1 },
640644 {"P" , CB_OP_ARG , NULL , 'P' },
@@ -4193,6 +4197,7 @@ process_command_line (const int argc, char **argv)
41934197 }
41944198 }
41954199
4200+ #ifdef EXPERIMENTAL_COPYBOOK_DEPS_OPTION
41964201 if (cb_flag_copybook_deps ) {
41974202 /* same as -M, but only COPYBOOK names */
41984203 cb_depend_output = 1 ;
@@ -4201,6 +4206,7 @@ process_command_line (const int argc, char **argv)
42014206 cb_depend_add_phony = 0 ;
42024207 cb_compile_level = CB_LEVEL_PREPROCESS ;
42034208 }
4209+ #endif
42044210 if (!cb_depend_output &&
42054211 (cb_depend_filename || cb_depend_add_phony || cb_depend_target
42064212 || cb_depend_keep_missing )) {
@@ -4257,6 +4263,10 @@ process_command_line (const int argc, char **argv)
42574263 cb_flag_alt_ebcdic ? "alternate" : "default" );
42584264 }
42594265
4266+ if (cob_load_collation (cb_ebcdic_table , ebcdic_to_ascii , ascii_to_ebcdic ) < 0 ) {
4267+ cobc_err_exit (_ ("invalid parameter: %s" ), "-febcdic-table" );
4268+ }
4269+
42604270 /* Exit on missing options */
42614271#ifdef COB_INTERNAL_XREF
42624272 if (cb_listing_xref && !cb_listing_outputfile ) {
@@ -4640,7 +4650,7 @@ process_filename (const char *filename)
46404650 fn -> preprocess = cobc_main_strdup (output_name );
46414651 } else
46424652 if (save_all_src || save_temps
4643- || cb_compile_level == CB_LEVEL_PREPROCESS ) {
4653+ || ( cb_compile_level == CB_LEVEL_PREPROCESS && ! cb_depend_output_only ) ) {
46444654 fn -> preprocess = cobc_main_stradd_dup (fbasename , ".i" );
46454655 } else {
46464656 fn -> preprocess = cobc_main_malloc (COB_FILE_MAX );
@@ -9335,9 +9345,11 @@ process_file (struct filename *fn, int status)
93359345 const char * sep = " \\\n" ;
93369346 FILE * file = NULL ;
93379347
9348+ #ifdef EXPERIMENTAL_COPYBOOK_DEPS_OPTION
93389349 if (cb_flag_copybook_deps ) {
93399350 sep = "" ;
93409351 }
9352+ #endif
93419353 if (cb_depend_file ) {
93429354 file = cb_depend_file ;
93439355 } else {
@@ -9354,9 +9366,14 @@ process_file (struct filename *fn, int status)
93549366 fprintf (file , "%s:%s" , basename , sep );
93559367 }
93569368
9357- for (l = cb_depend_list ; l ; l = l -> next ) {
9358- fprintf (file , " %s%s" , l -> text , l -> next ? sep : "\n\n" );
9369+ if (cb_depend_list ) {
9370+ for (l = cb_depend_list ; l ; l = l -> next ) {
9371+ fprintf (file , " %s%s" , l -> text , l -> next ? sep : "\n\n" );
9372+ }
9373+ } else {
9374+ fprintf (file , "\n\n" );
93599375 }
9376+
93609377 /* These lines should only be added with -MP */
93619378 if (cb_depend_add_phony ) {
93629379 for (l = cb_depend_list ; l ; l = l -> next ) {
0 commit comments