Here is an example of modified `makefile` based on the `Makefile` generated by Qmake under Qt/4.6.2/examples/opengl/textures.
prog = f90main
F90 = gfortran
F90FLAGS = -m32 -O1 -ffree-line-length-0 -ffree-form
LINK = gfortran
f90Objects = f90main.o
Qt = /mingw/Qt/4.6.2
CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_EVAL -DQT_DLL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -m32 -O2 -Wall $(DEFINES)
CXXFLAGS = -m32 -O2 -frtti -fexceptions -mthreads -Wall $(DEFINES)
INCPATH = -I'c:/minGW/Qt/4.6.2/include/QtCore' -I'c:/minGW/Qt/4.6.2/include/QtGui' -I'c:/minGW/Qt/4.6.2/include/QtOpenGL' -I'c:/minGW/Qt/4.6.2/include' \
-I'c:/minGW/Qt/4.6.2/include/ActiveQt' -I'tmp/moc/release_shared' -I'c:/minGW/Qt/4.6.2/mkspecs/win32-g++'
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows
LIBS = -L'c:/minGW/Qt/4.6.2/lib' -L'c:/minGW/Qt/4.6.2/lib' -lstdc++ -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain -lQtOpenGL4 -lQtGui4 -lQtCore4
####### Files
SOURCES = qtmain.cpp glwidget.cpp window.cpp moc_glwidget.cpp moc_window.cpp
OBJECTS = qtmain.o glwidget.o window.o moc_glwidget.o moc_window.o qrc_textures.o
TARGET = $(prog).exe
MOC = $(Qt)/bin/moc
####### Implicit rules
.SUFFIXES: .o .c .cpp .cc .cxx .C .f .h
.f.o:
$(F90) -c $(F90FLAGS) $(F90INCPATH) -o $@ $<
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
####### Build rules
$(TARGET): $(f90Objects) $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(f90Objects) $(OBJECTS) $(LIBS)
####### moc
moc_glwidget.cpp: glwidget.h
$(MOC) $(DEFINES) $(INCPATH) glwidget.h -o moc_glwidget.cpp
moc_window.cpp: window.h
$(MOC) $(DEFINES) $(INCPATH) window.h -o moc_window.cpp
####### rcc
RCC = $(Qt)/bin/rcc
qrc_textures.cpp: textures.qrc images/side4.png images/side5.png images/side6.png images/side1.png images/side2.png images/side3.png
$(RCC) -name textures textures.qrc -o qrc_textures.cpp
moc_glwidget.o: moc_glwidget.cpp window.h
moc_window.o: moc_window.cpp window.h
all: $(TARGET)
clean:
rm *.o
rm moc*.cpp
prog = f90main
F90 = gfortran
F90FLAGS = -m32 -O1 -ffree-line-length-0 -ffree-form
LINK = gfortran
f90Objects = f90main.o
Qt = /mingw/Qt/4.6.2
CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_EVAL -DQT_DLL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -m32 -O2 -Wall $(DEFINES)
CXXFLAGS = -m32 -O2 -frtti -fexceptions -mthreads -Wall $(DEFINES)
INCPATH = -I'c:/minGW/Qt/4.6.2/include/QtCore' -I'c:/minGW/Qt/4.6.2/include/QtGui' -I'c:/minGW/Qt/4.6.2/include/QtOpenGL' -I'c:/minGW/Qt/4.6.2/include' \
-I'c:/minGW/Qt/4.6.2/include/ActiveQt' -I'tmp/moc/release_shared' -I'c:/minGW/Qt/4.6.2/mkspecs/win32-g++'
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows
LIBS = -L'c:/minGW/Qt/4.6.2/lib' -L'c:/minGW/Qt/4.6.2/lib' -lstdc++ -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain -lQtOpenGL4 -lQtGui4 -lQtCore4
####### Files
SOURCES = qtmain.cpp glwidget.cpp window.cpp moc_glwidget.cpp moc_window.cpp
OBJECTS = qtmain.o glwidget.o window.o moc_glwidget.o moc_window.o qrc_textures.o
TARGET = $(prog).exe
MOC = $(Qt)/bin/moc
####### Implicit rules
.SUFFIXES: .o .c .cpp .cc .cxx .C .f .h
.f.o:
$(F90) -c $(F90FLAGS) $(F90INCPATH) -o $@ $<
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
####### Build rules
$(TARGET): $(f90Objects) $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(f90Objects) $(OBJECTS) $(LIBS)
####### moc
moc_glwidget.cpp: glwidget.h
$(MOC) $(DEFINES) $(INCPATH) glwidget.h -o moc_glwidget.cpp
moc_window.cpp: window.h
$(MOC) $(DEFINES) $(INCPATH) window.h -o moc_window.cpp
####### rcc
RCC = $(Qt)/bin/rcc
qrc_textures.cpp: textures.qrc images/side4.png images/side5.png images/side6.png images/side1.png images/side2.png images/side3.png
$(RCC) -name textures textures.qrc -o qrc_textures.cpp
moc_glwidget.o: moc_glwidget.cpp window.h
moc_window.o: moc_window.cpp window.h
all: $(TARGET)
clean:
rm *.o
rm moc*.cpp
To copy to clipboard, switch view to plain text mode
Bookmarks