| 1 | ifeq "$(SOURCE_PATH)" "" | 
|---|
| 2 | SOURCE_PATH = .. | 
|---|
| 3 | endif | 
|---|
| 4 |  | 
|---|
| 5 | # CMD.EXE version | 
|---|
| 6 |  | 
|---|
| 7 | ifeq "$(BUILD_PATH)" "" | 
|---|
| 8 | BUILD_PATH = .. | 
|---|
| 9 | endif | 
|---|
| 10 |  | 
|---|
| 11 | # | 
|---|
| 12 | # specific stuff for GNU make | 
|---|
| 13 | # | 
|---|
| 14 | CXX         =   g++ | 
|---|
| 15 | CFLAGS      =   -O -s -Zomf \ | 
|---|
| 16 | -I. -Igenerators -Igenerators/unix \ | 
|---|
| 17 | -Igenerators/win32 -Igenerators/mac \ | 
|---|
| 18 | -Igenerators/symbian -Igenerators/os2 \ | 
|---|
| 19 | -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ | 
|---|
| 20 | -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \ | 
|---|
| 21 | -I$(BUILD_PATH)/src/corelib/global \ | 
|---|
| 22 | -I$(BUILD_PATH)/src/corelib/xml \ | 
|---|
| 23 | -I$(SOURCE_PATH)/mkspecs/os2-g++ \ | 
|---|
| 24 | -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \ | 
|---|
| 25 | -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP \ | 
|---|
| 26 | -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ | 
|---|
| 27 | -DQT_BOOTSTRAPPED | 
|---|
| 28 | CXXFLAGS    =   $(CFLAGS) | 
|---|
| 29 | ifeq "$(EMXOMFLD_TYPE)" "WLINK" | 
|---|
| 30 | LFLAGS      =   -s -Zomf -Zstack 0x2000 -Zlinker DISABLE\ 1121 | 
|---|
| 31 | else | 
|---|
| 32 | LFLAGS      =   -s -Zomf -Zstack 0x2000 -Zlinker /PM:VIO -Zlinker /EXEPACK:2 | 
|---|
| 33 | endif | 
|---|
| 34 | LIBS        =   -lregistry.dll | 
|---|
| 35 | LINK        =   g++ $(LFLAGS) | 
|---|
| 36 | ADDCLEAN    = | 
|---|
| 37 |  | 
|---|
| 38 | ifdef QMAKE_OPENSOURCE_EDITION | 
|---|
| 39 | CFLAGS     += -DQMAKE_OPENSOURCE_EDITION | 
|---|
| 40 | endif | 
|---|
| 41 |  | 
|---|
| 42 | # make sure the output dir matches the one in qmake.pro | 
|---|
| 43 | OBJECTS_DIR = release-shared | 
|---|
| 44 |  | 
|---|
| 45 | # qmake code (taken from qmake.pri) | 
|---|
| 46 |  | 
|---|
| 47 | SOURCES     = \ | 
|---|
| 48 | project.cpp \ | 
|---|
| 49 | property.cpp \ | 
|---|
| 50 | main.cpp \ | 
|---|
| 51 | generators/makefile.cpp \ | 
|---|
| 52 | generators/unix/unixmake2.cpp \ | 
|---|
| 53 | generators/unix/unixmake.cpp \ | 
|---|
| 54 | meta.cpp \ | 
|---|
| 55 | option.cpp \ | 
|---|
| 56 | generators/win32/winmakefile.cpp \ | 
|---|
| 57 | generators/win32/mingw_make.cpp \ | 
|---|
| 58 | generators/makefiledeps.cpp \ | 
|---|
| 59 | generators/metamakefile.cpp \ | 
|---|
| 60 | generators/mac/pbuilder_pbx.cpp \ | 
|---|
| 61 | generators/xmloutput.cpp \ | 
|---|
| 62 | generators/win32/borland_bmake.cpp \ | 
|---|
| 63 | generators/win32/msvc_nmake.cpp \ | 
|---|
| 64 | generators/projectgenerator.cpp \ | 
|---|
| 65 | generators/win32/msvc_dsp.cpp \ | 
|---|
| 66 | generators/win32/msvc_vcproj.cpp \ | 
|---|
| 67 | generators/win32/msvc_objectmodel.cpp \ | 
|---|
| 68 | generators/symbian/symmake.cpp \ | 
|---|
| 69 | generators/symbian/symmake_abld.cpp \ | 
|---|
| 70 | generators/symbian/symmake_sbsv2.cpp \ | 
|---|
| 71 | generators/symbian/initprojectdeploy_symbian.cpp \ | 
|---|
| 72 | generators/os2/gnumake.cpp | 
|---|
| 73 |  | 
|---|
| 74 | # Qt code (taken from qmake.pri) | 
|---|
| 75 |  | 
|---|
| 76 | SOURCES    += \ | 
|---|
| 77 | $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \ | 
|---|
| 78 | $(SOURCE_PATH)/src/corelib/io/qbuffer.cpp \ | 
|---|
| 79 | $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp \ | 
|---|
| 80 | $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp \ | 
|---|
| 81 | $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \ | 
|---|
| 82 | $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \ | 
|---|
| 83 | $(SOURCE_PATH)/src/corelib/io/qdir.cpp \ | 
|---|
| 84 | $(SOURCE_PATH)/src/corelib/io/qdiriterator.cpp \ | 
|---|
| 85 | $(SOURCE_PATH)/src/corelib/io/qfile.cpp \ | 
|---|
| 86 | $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp \ | 
|---|
| 87 | $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp \ | 
|---|
| 88 | $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp \ | 
|---|
| 89 | $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp \ | 
|---|
| 90 | $(SOURCE_PATH)/src/corelib/global/qglobal.cpp \ | 
|---|
| 91 | $(SOURCE_PATH)/src/corelib/global/qnumeric.cpp \ | 
|---|
| 92 | $(SOURCE_PATH)/src/corelib/tools/qhash.cpp \ | 
|---|
| 93 | $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \ | 
|---|
| 94 | $(SOURCE_PATH)/src/corelib/tools/qlist.cpp \ | 
|---|
| 95 | $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp \ | 
|---|
| 96 | $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \ | 
|---|
| 97 | $(SOURCE_PATH)/src/corelib/global/qmalloc.cpp \ | 
|---|
| 98 | $(SOURCE_PATH)/src/corelib/tools/qmap.cpp \ | 
|---|
| 99 | $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp \ | 
|---|
| 100 | $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp \ | 
|---|
| 101 | $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp \ | 
|---|
| 102 | $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp \ | 
|---|
| 103 | $(SOURCE_PATH)/src/corelib/tools/qstring.cpp \ | 
|---|
| 104 | $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp \ | 
|---|
| 105 | $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp \ | 
|---|
| 106 | $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp \ | 
|---|
| 107 | $(SOURCE_PATH)/src/corelib/io/qurl.cpp \ | 
|---|
| 108 | $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp \ | 
|---|
| 109 | $(SOURCE_PATH)/src/corelib/io/qsettings.cpp \ | 
|---|
| 110 | $(SOURCE_PATH)/src/corelib/global/qlibraryinfo.cpp \ | 
|---|
| 111 | $(SOURCE_PATH)/src/corelib/kernel/qvariant.cpp \ | 
|---|
| 112 | $(SOURCE_PATH)/src/corelib/tools/qvector.cpp \ | 
|---|
| 113 | $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp \ | 
|---|
| 114 | $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp \ | 
|---|
| 115 | $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp \ | 
|---|
| 116 | $(SOURCE_PATH)/src/corelib/io/qfsfileengine_os2.cpp \ | 
|---|
| 117 | $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator_os2.cpp \ | 
|---|
| 118 | $(SOURCE_PATH)/src/corelib/io/qsettings_os2.cpp | 
|---|
| 119 |  | 
|---|
| 120 | define SRC_TO_OBJ | 
|---|
| 121 | $(OBJECTS_DIR)\$(basename $(notdir $(1))).obj | 
|---|
| 122 | endef | 
|---|
| 123 |  | 
|---|
| 124 | OBJECTS     = $(foreach src,$(SOURCES),$(call SRC_TO_OBJ,$(src))) | 
|---|
| 125 |  | 
|---|
| 126 | qmake.exe: $(OBJECTS_DIR) $(OBJECTS) | 
|---|
| 127 | $(LINK) -o $@ $(OBJECTS) $(LIBS) | 
|---|
| 128 | ifneq "$(QMAKE_EXEPACK)" "" | 
|---|
| 129 | $(QMAKE_EXEPACK) $(QMAKE_EXEPACK_FLAGS) $@ $(QMAKE_EXEPACK_POST_FLAGS) | 
|---|
| 130 | endif | 
|---|
| 131 | copy $@ $(BUILD_PATH)\bin\ | 
|---|
| 132 |  | 
|---|
| 133 | $(OBJECTS_DIR): | 
|---|
| 134 | @mkdir $(OBJECTS_DIR) | 
|---|
| 135 |  | 
|---|
| 136 | Makefile: Makefile.os2-g++ | 
|---|
| 137 | @echo "Out of date, please rerun configure" | 
|---|
| 138 |  | 
|---|
| 139 | define DEL_ONE | 
|---|
| 140 | clean:: | 
|---|
| 141 | -del $(1) >nul 2>&1 | 
|---|
| 142 | endef | 
|---|
| 143 |  | 
|---|
| 144 | $(foreach file,$(OBJECTS) $(ADDCLEAN),$(eval $(call DEL_ONE,$(file)))) | 
|---|
| 145 |  | 
|---|
| 146 | distclean:: clean | 
|---|
| 147 | -del qmake.exe >nul 2>&1 | 
|---|
| 148 |  | 
|---|
| 149 | .SUFFIXES: .cpp .c | 
|---|
| 150 |  | 
|---|
| 151 | .c.obj: | 
|---|
| 152 | $(CXX) -c $(CFLAGS) -o $@ $< | 
|---|
| 153 |  | 
|---|
| 154 | .cpp.obj: | 
|---|
| 155 | $(CXX) -c $(CXXFLAGS) -o $@ $< | 
|---|
| 156 |  | 
|---|
| 157 | define SRC_TO_OBJ_RULE | 
|---|
| 158 | $(call SRC_TO_OBJ,$(1)): $(1) | 
|---|
| 159 | $(CXX) -c $(CXXFLAGS) -o $$@ $$< | 
|---|
| 160 | endef | 
|---|
| 161 |  | 
|---|
| 162 | $(foreach src,$(SOURCES),$(eval $(call SRC_TO_OBJ_RULE,$(src)))) | 
|---|