我想创建一个通用的makefile,它可以使用源文件名对其进行编译,将其保存为目标文件和可执行文件。两个文件都使用原始源名称。谢谢您的帮助。
exec: \
compile
./helloworld #I would like to input source outside the make file.
compile: \
helloworld.c
gcc -Wall helloworld.c -o helloworld #<==
echo 'compiling'
touch compile
#I would like makefile to automatically save both object and exec.
#as the source file name.