1

In the program below, there are two things that I don't understand.

  1. How can I use this makefile in Microsoft VC?

  2. 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

1 Answer 1

6
  1. There is a makefile project type in Visual Studio. Otherwise it is most likely the makefile is intended to be run by nmake.

  2. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.