########################################################################
########################### MIDACO MAKEFILE ############################
########################################################################
# Windows, MinGW-w64 gfortran   -   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 midacof.lib of the Windows
# download).
LIBRARY = midacof.lib

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

# Specify Compiler
COMPILER = gfortran 

# Set Compiler Flags
FLAGS = -O3 -Wall

########################################################################
########################### COMPILE AND LINK ###########################
########################################################################
.SUFFIXES: .f   $(SUFFIXES)
.SUFFIXES: .F   $(SUFFIXES)
.SUFFIXES: .for $(SUFFIXES)
.SUFFIXES: .FOR $(SUFFIXES)
.SUFFIXES: .f90 $(SUFFIXES)
.SUFFIXES: .F90 $(SUFFIXES)
########################################################################
.f.o:
	$(COMPILER) -c $(FLAGS) $?
.F.o:
	$(COMPILER) -c $(FLAGS) $?
.for.o:
	$(COMPILER) -c $(FLAGS) $?
.FOR.o:
	$(COMPILER) -c $(FLAGS) $?
.f90.o:
	$(COMPILER) -c $(FLAGS) $?
.F90.o:
	$(COMPILER) -c $(FLAGS) $?
########################################################################
all:$(SOURCES)
	$(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 ############################
########################################################################





