home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / EFFO / forum5.lzh / SPRACHEN / C / GSHELL / assembler.c next >
C/C++ Source or Header  |  1988-04-20  |  796b  |  42 lines

  1. #include <stdio.h>
  2. #include "selectfile.h"
  3.  
  4. #define COMPILER "cc"
  5.  
  6. usage()
  7. {
  8.     fprintf(stderr,"Syntax: assembler [<path>]\n");
  9.     fprintf(stderr,"Function: a menue driven assembler shell\n");
  10.     fprintf(stderr,"Options: none\n");
  11.     exit(1);
  12. }
  13.  
  14.  
  15. main(argc,argv)
  16. int argc;
  17. char *argv[];
  18. {
  19.     char prog[100],dir[100],h[100];
  20.     if(argc==2) {
  21.         if(strcmp(argv[1],"-?")==0) usage();
  22.         strcpy(dir,argv[1]);
  23.     } else strcpy(dir,".");
  24.     while(select_file("Assembler-SHELL  V1.0           Uwe Simon  1988",
  25.             "Assemble what File ?",dir,CHD|PARA,"*.a",prog)) {
  26.         
  27.         strcpy(h,COMPILER);
  28.         strcat(h," ");
  29.         if(strcmp(dir,".")&&(prog[0]!='/')) {
  30.             strcat(h,dir); strcat(h,"/");
  31.         }
  32.         strcat(h,prog);
  33.         system(h);
  34.         printf("\n\n >>>>>>> press <CR> <<<<<<<"); fflush(stdout);
  35.         readln(0,prog,1);
  36.     }
  37.     printf("\n\n");
  38. }
  39.  
  40.  
  41.  
  42.