This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpp-placeholder() { | |
echo "Creating cpp boilerplate..." | |
echo "To run just do 'make'." | |
printf "# Compiler\nCXX = g++\n\n# Compiler flags\nCXXFLAGS = -Wall -Wextra -std=c++17\n\n# Output executable\nTARGET = main\n\n# Source file\nSRC = main.cpp\n\n# Default target\ndefault: all run clean\n\n# Build target\nall: \$(TARGET)\n\n# Compile the source file directly into executable\n\$(TARGET): \$(SRC)\n\t\$(CXX) \$(CXXFLAGS) -o \$(TARGET) \$(SRC)\n\n# Run the application\nrun: \$(TARGET)\n\t./\$(TARGET)\n\n# Clean the build files\nclean:\n\trm -f \$(TARGET)\n" > Makefile | |
printf "#include <stdio.h>\nint main(int argc, char** argv) {\n (void) argc;\n (void) argv;\n printf(\"Boilerplate file...\x5c\x6e\");\n return 0;\n}\n" > main.cpp | |
} |