views:

237

answers:

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
+5  A: 
  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.

Drakonite