CC = cl.exe LINK = link.exe # 编译和链接选项 CFLAGS = /nologo /W3 /EHsc /Ox /DNDEBUG /MT /I ..\TypeLibs LDFLAGS = /nologo libcmt.lib libcpmt.lib Gdi32.lib user32.lib Kernel32.lib # 源文件和最终输出 SOURCE = main.cpp cdrapp.cpp OBJECT = $(SOURCE:.cpp=.obj) TARGET = app.exe all: $(TARGET) $(TARGET): $(OBJECT) $(LINK) $(LDFLAGS) /out:$(TARGET) $(OBJECT) %.obj: %.cpp $(CC) $(CFLAGS) /c $< clean: del /Q *.obj *.dll *.exe VGCoreAuto.tlh VGCoreAuto.tli ## 单行命令编译 ## cl.exe /EHsc /Ox /DNDEBUG main.cpp cdrapp.cpp /Fe:app.exe Gdi32.lib user32.lib Kernel32.lib