This shell script will scan the folders and sub folders looking for *.c and *.h files and generate a simple makefile.
By default, this script will look for .c and .h files but the -t option can be used to search for other file types such as .cpp, .sh, etc.. When this script creates the makefile for .c files, a compiler of 'CC' is used and when .cpp files is specified, the compiler is 'C++'.
mkgen -n name [-t "*.c"]
-n name - A name for the target.
-t type - A file type to look for. Currently, this script will accept: *.c, *.cpp, *.sh types (default is *.c). If *.c or .cpp called for, header files (.h) file are also looked for and listed in makefile and placed as a dependency for the building of main. When specifying *.sh files as the type, no header files are looked for but the CC is set to "chmod" (-i.e., a directory of *.sh files will need a makefile for easy installation vs compilation).
To create a makefile for all *.c file under the subdirectory:
% mkgen -n fooTo create a makefile for all *.cpp files under the subdirectory:
% mkgen -n foo -t *.cppTo create a makefile for all *.sh files under the subdirectory:
% mkgen -n foo -t *.shTo clone a copy:
$ cd ~/<place>/<you>/<keep>/<your>/<code>
$ git clone git@git.local:john/mkgen.git$ cd mkgen
$ make ; make install- Commit each file as changes are made
- Do not commit files in batch
- Please prefix all commits with the file you are committing
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
Created for my personal use.
- John Kaul