########################################################################
########################### MIDACO MAKEFILE ############################
########################################################################
# Windows, MinGW-w64 gcc   -   run with:  mingw32-make -f makefile_mingw_windows
# (in the Windows command prompt, with the MinGW-w64 bin folder on the PATH)
########################################################################
        
# Specify Program Name
PROGRAM = run.exe

# Specify Source Codes
SOURCES = example_MINLPc.o

# The MIDACO library for Windows (the file midacoc.lib of the Windows
# download). C++ programs include midaco.h, which declares the
# interface as extern "C"; for example_MINLPc.cpp set CPP_COMPILER
# to g++ and remove example_MINLPc.c from this folder.
LIBRARY = midacoc.lib

# The commands below are those of the Windows command prompt
SHELL = cmd.exe

# Specify Compiler
C___COMPILER = gcc
CPP_COMPILER = gcc

# Set Compiler Flags
FLAGS = -O3 -Wall

########################################################################
########################### COMPILE AND LINK ###########################
########################################################################
.SUFFIXES: .c     $(SUFFIXES)
.SUFFIXES: .C     $(SUFFIXES)
.SUFFIXES: .cpp   $(SUFFIXES)
.SUFFIXES: .CPP   $(SUFFIXES)
########################################################################
.c.o:
	     $(C___COMPILER) -c $(FLAGS) $?
.C.o:
	     $(C___COMPILER) -c $(FLAGS) $?
.cpp.o:
	     $(CPP_COMPILER) -c $(FLAGS) $?
.CPP.o:
	     $(CPP_COMPILER) -c $(FLAGS) $?
########################################################################
all:$(SOURCES)
	  $(CPP_COMPILER) -o $(PROGRAM) $(SOURCES) $(LIBRARY) -lm -static
########################################################################
############################## CLEANING ################################
########################################################################
clean:
	  -del /Q *.o $(PROGRAM) 2>nul
# Make Extra Clean
xclean:
	  -del /Q *.o $(PROGRAM) *.TXT *.out 2>nul
########################################################################
########################### END OF MAKEFILE ############################
########################################################################





