mkmk/ 40700 0 0 0 5476225511 7774 5ustar rootrootmkmk/Makefile100600 0 0 533 5476221222 11507 0ustar rootroot# Generated by makegen.... TARGET = mkmk OBJECTS = mkmk.o curses.o file.o make.o CC = gcc CFLAGS = -s -N -O2 LIBS = -lncurses all: mkmk mkmk: $(OBJECTS) $(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) clean: rm -f a.out core *~ \#* *.bak $(TARGET) $(OBJECTS) install: install -s -m 755 mkmk /usr/bin install -m 755 mkmk.1 /usr/man/man1mkmk/curses.c100600 0 0 4246 5476221136 11550 0ustar rootroot#include #include #include #include "mkmk.h" extern int lib; void init_curses() { initscr(); cbreak(); noecho(); wrefresh(stdscr); } void credits() { printw("Mkmk %s (linux)\nCopyright 1993 Free Software Foundation, Inc...\n\n\n\n",VERSION); } void boundary_input(char *string, char *prompt,char *defaults, int ACCEPT_NONE, char *teststr) { int curx,cury; int length=0; char x; curx=stdscr->_curx; cury=stdscr->_cury; move(3,0); clrtoeol(); printw("%s", teststr); stdscr->_curx=curx; stdscr->_cury=cury; printw("[%s] (%s",prompt,defaults); wrefresh(stdscr); insch(')'); stdscr->_curx=stdscr->_curx-strlen(defaults); wrefresh(stdscr); do { x=getch(); switch (x) { case '\n': if(length==0) if((strcmp(defaults,"none"))==0 && ACCEPT_NONE) { strcpy(string," "); stdscr->_curx=stdscr->_curx+strlen(defaults); break; } else if(ACCEPT_NONE==0) { x=0; break; } else { strcpy(string,defaults); stdscr->_curx=stdscr->_curx+strlen(defaults); break; } break; case 127: if (length) { clrtoeol(); stdscr->_curx=stdscr->_curx-1; delch(); insch(')'); string[length--]=0; wrefresh(stdscr); } if(length%50==0 && length > 0) { delch(); stdscr->_cury=stdscr->_cury-1; stdscr->_curx=stdscr->_curx+50; insch(')'); wrefresh(stdscr); } break; default: if(length==0) { clrtoeol(); wrefresh(stdscr); string[length++]=x; string[length]=0; insch(x); stdscr->_curx=stdscr->_curx+1; wrefresh(stdscr); insch(')'); break; } if(length%50==0) { delch(); stdscr->_cury=stdscr->_cury+1; stdscr->_curx=stdscr->_curx-50; insch(')'); wrefresh(stdscr); } string[length++]=x; string[length]=0; insch(x); stdscr->_curx=stdscr->_curx+1; break; } } while ((length < 1000) && (x != '\n')); stdscr->_curx=stdscr->_curx+2; printw("\n"); wrefresh(stdscr); } mkmk/make.c100600 0 0 2153 5476200117 11150 0ustar rootroot#include #include "mkmk.h" extern int lib; extern int include; makefile_create(char *ProgName, char *ObjName, char *CCFlags, char *CC, char *ExtraLibs, char *LibDir, char *IncDir, char *INSTALLDIR, char *MODE) { FILE *Makefile; rename("Makefile","Makefile.bak"); Makefile=fopen("Makefile","w"); fprintf(Makefile,"# Generated by makegen....\n\n"); fprintf(Makefile,"TARGET = %s\n",ProgName); fprintf(Makefile,"OBJECTS = %s\n\n",ObjName); fprintf(Makefile,"CC = %s\n",CC); fprintf(Makefile,"CFLAGS = %s $(INCDIR)\n\n",CCFlags); fprintf(Makefile,"LIBS = %s\nLIBDIR = %s\nINCDIR = %s\n\nINSTALLDIR = %s\n\n" ,ExtraLibs,LibDir,IncDir,INSTALLDIR); fprintf(Makefile,"all: $(TARGET)\n\n"); fprintf(Makefile,"$(TARGET): $(OBJECTS)\n"); fprintf(Makefile,"\t$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LIBDIR) $(LIBS)\n\n"); fprintf(Makefile,"clean:\n\trm -f a.out core *~ \\#* *.bak $(TARGET) $(OBJECTS)\n\n"); if(include) fprintf(Makefile,"install:\n\tinstall -s -m %s $(TARGET) $(INSTALLDIR)\n",MODE); fclose(Makefile); printf("Created Makefile...\n"); fflush(stdout); } mkmk/mkmk.h100600 0 0 30 5476146416 11142 0ustar rootroot#define VERSION "1.0" mkmk/README100600 0 0 1724 5476225511 10757 0ustar rootrootmkmk 1.0 (kia@csa.bu.edu) This program was designed for people who have little or no knowledge of makefiles and need to create one. It works by asking a series of basic questions and then creating a makefile from the answers. This program is probably by no means suitible for more than small projects, but then again, its usefulness remains to be seen. The file mkrc can be used to speed things up by storing personal makefile defaults, such as compiler flags, compiler, etc. By default mkmk searches for ~/.mkrc or /usr/lib/mkrc. Look at mkrc.sample for instructions and possible keywords. The -m flag can be used to specify a different rc file. You need ncurses-1.8 and terminfo entries for the current terminal to run mkmk. These can be retrieved from the ncurses-1.8.tar.gz archive. To compile: make make install To run: type mkmk...;) Check the manual page for additional information and please email any bugs or suggestions to kia@csa.bu.edu. Karl Asha mkmk/mkrc.sample100600 0 0 262 5476221305 12207 0ustar rootrootThe mgrc file is searched for in ~/.mkrc or /usr/lib/mkrc Possible options are DEFCC/DEFINCDIR/DEFLIBDIR/DEFCFLAGS used in the format: KEYWORD=value DEFCC=gcc DEFCFLAGS=-O2 mkmk/mkmk.c100600 0 0 4601 5476221125 11174 0ustar rootroot#include #include #include #include "mkmk.h" int include=0; char DEFTARGET[255]="none"; char DEFCC[255]="gcc"; char DEFLIBS[255]="none"; char DEFOBJECTS[255]="none"; char DEFCFLAGS[255]="none"; char DEFLIBDIR[255]="none"; char DEFINCDIR[255]="none"; main(int argc,char *argv[]) { FILE *Makefile,*mgrc; char CCFlags[255]; char ProgName[255]; char ObjName[255]; char Libs[255]; char CC[255]; char IncDir[255]; char LibDir[255]; char INSTALLDIR[255]; char MODE[255]; char path[255]; int option=0; int private=0; char y; while ((option = getopt(argc, argv, "hlm:")) != EOF) switch(option) { case 'm': private=1; sprintf(path,"%s",optarg); if((mgrc=fopen(path,"r"))!=NULL) read_mgrc(mgrc); break; case 'h': default: printf("usage: %s [-h] [-m rcfile]\n",argv[0]); exit(0); } sprintf(path,"%s/.mkrc",getenv("HOME")); if(!private) if((mgrc=fopen(path,"r"))!=NULL) read_mgrc(mgrc); else if((mgrc=fopen("/usr/lib/mkrc","r"))!=NULL) read_mgrc(mgrc); init_curses(); credits(); boundary_input(ProgName,"TARGET","no default",0,"(Enter the target program name)"); boundary_input(ObjName,"OBJECTS","no default",0,"(Enter the object files to be used [.o])"); boundary_input(CCFlags,"CFLAGS",DEFCFLAGS,1,"(Enter any compiler flags to be used)"); boundary_input(CC,"CC",DEFCC,1,"(Enter the name of the compiler to be used)"); boundary_input(Libs,"LIBS",DEFLIBS,1,"(Enter any addition libraries needed. Precede them with \"-l\")"); boundary_input(LibDir,"LIBDIR",DEFLIBDIR,1,"(Enter any additional library search paths. Precede each with \"-L\")"); boundary_input(IncDir,"INCDIR",DEFINCDIR,1,"(Enter any addition header search paths. Precede each with \"-I\")"); printw("\nInstall Procedure? [y]"); stdscr->_curx=stdscr->_curx-2; y=getch(); delch(); insch(y); stdscr->_curx=stdscr->_curx+2; wrefresh(stdscr); switch(y) { case 'n': printf("\n"); break; case 'y': case '\n': printw("\n"); include=1; boundary_input(INSTALLDIR,"INSTALLDIR","no default",0,"(Enter the full path in which to install the program)"); boundary_input(MODE,"MODE","no default",0,"(Enter the permissions for the program)"); break; } makefile_create(ProgName,ObjName,CCFlags,CC,Libs,LibDir,IncDir,INSTALLDIR,MODE); endwin(); } mkmk/file.c100600 0 0 1643 5476177616 11176 0ustar rootroot#include #include extern char DEFTARGET[255]; extern char DEFCC[255]; extern char DEFLIBS[255]; extern char DEFOBJECTS[255]; extern char DEFCFLAGS[255]; extern char DEFLIBDIR[255]; extern char DEFINCDIR[255]; void read_mgrc(FILE *mgrc) { char string[255]; char *p; int i; char *k[] = {"DEFCC","DEFLIBS","DEFCFLAGS","DEFLIBDIR", "DEFINCDIR"}; while(!feof(mgrc)) { fgets(string,255,mgrc); string[strlen(string)-1]=0; p=strtok(string,"= \t"); for(i=0;i<5;++i) { if((strcmp(k[i],string))==0) { p=strtok(NULL,"="); switch(i) { case 0: strcpy(DEFCC,p); break; case 1: strcpy(DEFLIBS,p); break; case 2: strcpy(DEFCFLAGS,p); break; case 3: strcpy(DEFLIBDIR,p); break; case 4: strcpy(DEFINCDIR,p); break; } } } } } mkmk/mkmk.1100400 0 0 1735 5476220356 11122 0ustar rootroot.Id $Id: mkmk.1,v 1.0 1993/11/29 23:41:29 kernel Exp $ .TH MKMK 1 "Nov 1993" local "USER COMMANDS" .SH NAME mkmk \- Makefile generation utility .SH SYNOPSIS .B mkmk .RB [ -f .IR file ] .RB [ -h ] .br .SH DESCRIPTION .B mkmk uses a series of interactively defined items to create a standard Makefile. In particular, object files (.o), program names, compiler flags, etc. .br By default .B mkmk tries to retrieve user defined defaults from .B ~/.mkrc or .B /usr/lib/mkrc. Entries follow the format: .br keyword=value .br Possible keywords include: .br .B DEFCC Default compiler. .br .B DEFCFLAGS Default compiler flags. .br .B DEFCINCDIR Default directories to search for headers. .br .B DEFLIBDIR Default directories to search for libaries. .br .SH OPTIONS .TP 8 .B \-h Displays the command line format. .TP 8 .BI \-f " file" Uses .BI file as the rc file instead of 'mkrc'. .SH FILES .I /usr/lib/mkrc .br .I ~/.mkrc .br .SH BUGS I wrote, didn't I?