diff --git a/libasn1compiler/asn1c_save.c b/libasn1compiler/asn1c_save.c index 2db1c2ef..00a4496e 100644 --- a/libasn1compiler/asn1c_save.c +++ b/libasn1compiler/asn1c_save.c @@ -52,12 +52,22 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir) { TQ_FOR(arg->expr, &(arg->mod->members), next) { if(asn1_lang_map[arg->expr->meta_type] [arg->expr->expr_type].type_cb) { - fprintf(mkf, "\t\\\n\t%s.c %s.h", - arg->expr->Identifier, + fprintf(mkf, "\t\\\n\t%s.c", arg->expr->Identifier); } } } + fprintf(mkf, "\n\nASN_MODULE_HEADERS="); + TQ_FOR(arg->mod, &(arg->asn->modules), mod_next) { + TQ_FOR(arg->expr, &(arg->mod->members), next) { + if(asn1_lang_map[arg->expr->meta_type] + [arg->expr->expr_type].type_cb) { + fprintf(mkf, "\t\\\n\t%s.h", + arg->expr->Identifier); + } + } + } + fprintf(mkf, "\n\n"); /* * Move necessary skeleton files and add them to Makefile.am.sample. @@ -75,6 +85,7 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir) { for(i = 0; i < dlist->el_count; i++) { char *fname = dlist->elements[i]->filename; + char *dotH; assert(strlen(fname) < (sizeof(buf) / 2)); strcpy(dir_end, fname); @@ -83,15 +94,38 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir) { fprintf(mkf, ">>>ABORTED<<<"); fclose(mkf); return -1; + } + dotH = strrchr(fname, 'h'); + if(dotH && fnamemod->Identifier, arg->mod->source_file_name @@ -166,7 +201,8 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) { fprintf(fp_h, "/*\n" " * Generated by asn1c-" VERSION " (http://lionet.info/asn1c)\n" - " * From ASN.1 module \"%s\" found in \"%s\"\n" + " * From ASN.1 module \"%s\"\n" + " * \tfound in \"%s\"\n" " */\n\n", arg->mod->Identifier, arg->mod->source_file_name