In the program below, there are two things that I don't understand.
How can I use this makefile in Microsoft VC?
Why there is a '?' before '='?
Program:
ifeq ($(TARGET_COMPILER),ms)
include ../makefile.ms.config
DBG?= /Zi
OPT= /Ox
CXXFLAGS += $(COMMON_FLAGS) $(OPT) $(DBG)
EEXT = $(EXT).dll
ifeq ($(GZSTREAM),1)
MYLIBS = src/gzstream/lib/zlib.lib
endif
endif
There is a makefile project type in Visual Studio. Otherwise it is most likely the makefile is intended to be run by nmake.
The syntax '?=' means assign value if the variable is undefined. In other words, if DBG has not been set, it will set it to /Zi, otherwise if DBG current has the value /Z0, it will keep it's current value of /Z0.