我有以下 Makefile:
all: hello.exe hellogtk.exe hellogtktng.cs
hello.exe: hello.cs
gmcs hello.cs
hellogtk.exe: hellogtk.cs
gmcs -pkg:gtk-sharp-2.0 hellogtk.cs
hellogtktng.exe: hellogtktng.cs
gmcs -pkg:gtk-sharp-2.0 hellogtktng.cs
clean:
rm -f *.exe
我才刚刚开始学习如何编写Makefile,我觉得这一切都有些重复。 Makefile 专业人士将如何做这件事?
最佳答案
all: hello.exe hellogtk.exe hellogtktng.exe
%.exe: %.cs
gmcs -pkg:gtk-sharp-2.0 $<
clean:
rm -f *.exe
关于makefile - 如何使 Makefile 更短?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3274810/