Index of /makegen/

NameLast ModifiedSize
UpParent Directory
FileCHECKSUM.MD52020-11-20 02:12 4k
[TXT]main.c2020-11-20 02:12 4k
FileMakefile2020-11-20 02:12 4k
[CMP]makegen-2.0.tar.gz2020-11-20 02:12 8k
[CMP]makegen.7.gz2020-11-20 02:12 4k
[TXT]makegen.c2020-11-20 02:12 8k
[TXT]makegen.h2020-11-20 02:12 4k
CENTAUR MAKEFILE GENERATOR -------------------------- Version 2.0 11/19/2020 <> ABOUT ----- Generate Makefiles for C programs with minimal user input. TABLE OF CONTENTS ----------------- 1. Compiling & Installation 2. Makegen Information File (.makeinfo) 3. Generated Makefile 4. Command Line Parameters 5. Examples 1. COMPILING & INSTALLATION --------------------------- By default, makegen will not display the contents of a generated Makefile to the screen; it will only create the file. To change this behavior, uncomment the '#define SHOW_OUTPUT' line (line 19) in the file 'makegen.h'. This will cause the program to display the output on the screen as it is written to the file. To build the 'makegen' binary: $ make To move the 'makegen' binary to /usr/bin and copy the manual page file 'makegen.7.gz' to /usr/share/man/man7: $ make install To remove the object files generated by make: $ make clean To delete the installed binary and manual: $ make uninstall 2. MAKEGEN INFORMATION FILE (.makeinfo) --------------------------------------- Centaur Makefile Generator prepends a comment header to a Makefile using information populated from the '.makeinfo' file in the current directory. This file is optional and should be created by the user, composed of only two lines: the program's full name as the first line; the program's version number as the second line. If '.makeinfo' is not found, the program's name will be the same as the output file (given with the '-o' option; 'main' if not set), and the version line will read '(unknown)'. Once the 'makegen' command has been successfully executed, the '.makeinfo' file in the directory can be deleted. Example Contents of .makeinfo ----------------------------- Centaur Makefile Generator 2.0 3. GENERATED MAKEFILE --------------------- makegen will attempt to create a Makefile in the user's current working directory. If a Makefile already exists, the user is prompted before overwrite. '.c' and '.h' files are automatically populated; there is no need to enter them on the command line. If no files with file extension '.c' are found in the directory, the program will display an error and exit. It is assumed by makegen that gcc will be used as the C compiler. This and other options may be changed at compile time in the file 'makegen.h', constant definition '_MAKEFILE'. All defaults are stored in the '_DEFAULTS' array at the top of the file 'main.c' Besides the main instruction to build a C project, makegen also adds three other instructions to a new Makefile: 'install', 'clean', and 'uninstall'. 'install' will copy the compiled binary to the directory specified with '-d' on the command line (default: /usr/bin). 'clean' will delete all '.o' files generated in the directory. 'uninstall' will delete the compiled binary from the directory specified with '-d' on the command line (default: /usr/bin). 4. COMMAND LINE PARAMETERS -------------------------- Syntax: makegen [-o prog-name] [-L 'library-args'] [-d install-dir] makegen [-h] Files in current directory with extension '.h' and '.c' are populated automatically. All parameters are optional, but must be given in the above order (i.e. -o, -L, -d) when used. prog-name defaults to 'main' when '-o' is not used. library-args defaults to null when '-L' is not used. library-args should be given as they would be for gcc (e.g. -lcrpyto), separated by a space. Enclose in single-quotes ('') as shown above if using space characters in library-args. install-dir defaults to '/usr/bin' when '-d' is not used. The '-h' option displays command syntax and usage. 5. EXAMPLES ----------- Assuming current directory contains files 'program.c', 'program.h', 'main.c', and does not contain '.makeinfo': Running makegen with no parameters will set the binary name to 'main'. $ makegen Output: /home/jon/program/Makefile created successfully Contents of Makefile: # Makefile for main # Version (unknown) # Generated 11/19/2020 CC=gcc CFLAGS=-I. DEPS=program.h %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) main: main.o program.o $(CC) -o main main.o program.o install: mv -v main /usr/bin clean: rm -v *.o uninstall: rm -i /usr/bin/main Another example, using all command line options (and '.makeinfo' is present): Assuming current working directory contains files 'md5.c', 'main.c', 'md5.h', '.makeinfo': Contents of .makeinfo: Centaur MD5 1.3 $ makegen -o md5 -L -lcrypto -d /usr/local/bin Output: /home/jon/md5/Makefile created successfully Contents of Makefile: # Makefile for Centaur MD5 # Version 1.3 # Generated 11/19/2020 CC=gcc CFLAGS=-I. DEPS=md5.h %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) md5: main.o md5.o $(CC) -lcrypto -o md5 main.o md5.o install: mv -v md5 /usr/local/bin clean: rm -v *.o uninstall: rm -i /usr/local/bin/md5
Proudly Served by LiteSpeed Web Server at Port 443