This project is a small tool designed for 42 students, tested on the latest version of Ubuntu. It helps you generate a customizable Makefile for your C or C++ projects.
Run the installation script:
bash install.shThis script will:
- Create a
~/.maker/directory to store the main scriptmaker.sh. - Copy the
maker.shscript to that directory. - Add an alias
makerto your.zshrcfile. - Reload your
.zshrcso the alias is immediately available.
Use the alias to run the tool:
makerThe script will ask you the following questions:
1οΈβ£ What is the program name?
Example: a.out
This will be the name of the compiled binary.
2οΈβ£ What is the directory containing the source files?
Example: src
Provide the path to your .c or .cpp files.
3οΈβ£ What is the directory containing the includes?
Example: include
Provide the directory path for your header files (leave blank if none).
4οΈβ£ What language? (c/cpp)
Choose the language of your project: c or cpp.
Once you provide the answers, the script will:
β
Check that the directories exist.
β
Automatically find all source files (*.c or *.cpp).
β
Create a Makefile with:
all,clean,fclean, andrerules.- Dynamic object directory creation.
- Automatic dependency management for C++ projects.
make: Compile the project.make clean: Remove the object directory.make fclean: Remove objects and the compiled binary.make re: Clean and recompile the project.
The maker.sh script is installed in ~/.maker/.
The maker alias lets you run it from any project.
This project is open-source and free for 42 students. No warranty β just have fun!
Enjoy coding! π