Hi, I decided to try and learn how to build programs through the command line and make files instead of relying on Visual Studio to do this for me. After familiarizing myself with the compilation process into .obj files and binding, I switched to NMake. I wrote the main make file to try to compile the source files located in several folders into .obj files, link each folder of .obj files to .lib files, and then link the .lib files to the .exe file.
CC=cl /c /EHsc /Fo LIB=lib /OUT: LINKER=link /OUT: EXEC_NAME=Test.exe DEL=del MAKE=nmake OUT=.\out all: $(OUT)\*.lib $(LINKER)$(EXEC_NAME) *.lib clean: $(DEL) $(OUT) rebuild: $(MAKE) clean $(MAKE) all $(OUT)%.lib: $(OUT)\%\*.obj $(LIB)%.lib $(OUT)%\*.obj %(OUT)\%\: $(CC)$(OUT)\%\ .\%\*.cpp
When I try to run it with nmake all , it tells me: NMAKE : fatal error U1073: don't know how to make '.\out\*.lib'
Thanks in advance.
source share