Hi I decided to try and learn how to build programs via the command line and makefiles instead of relying on Visual Studio to do it for me. After familiarizing myself with the process of compiling into .obj files and linking, I moved onto NMake. I've written a basic makefile to try and compile source files located in multiple folders into .obj files, link each folder of .obj files into .lib files and then link the .lib files into a .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.