o switch to v46
This commit is contained in:
@@ -1,94 +1,66 @@
|
||||
##############################
|
||||
### platform configuration ###
|
||||
##############################
|
||||
|
||||
objects := main $(if $(call streq,$(platform),win),resource) $(objects)
|
||||
|
||||
ifeq ($(platform),mac)
|
||||
moc = moc
|
||||
rcc = rcc
|
||||
link +=-F/Developer/SDKs/Qt/lib \
|
||||
-L/Developer/SDKs/Qt/lib \
|
||||
-framework QtOpenGL \
|
||||
-framework QtGui \
|
||||
-framework Carbon \
|
||||
-framework AppKit \
|
||||
-framework QtCore
|
||||
qtflags= -I/Developer/SDKs/Qt/include/ \
|
||||
-I/Developer/SDKs/Qt/include/Qt \
|
||||
-I/Developer/SDKs/Qt/include/QtCore \
|
||||
-I/Developer/SDKs/Qt/include/QtGui
|
||||
|
||||
|
||||
ifeq ($(moc),)
|
||||
moc := moc
|
||||
endif
|
||||
|
||||
ifeq ($(rcc),)
|
||||
rcc := rcc
|
||||
endif
|
||||
ifeq ($(platform),x) # X11
|
||||
moc = moc-qt4
|
||||
rcc = rcc
|
||||
link += $(call mklib,Xtst)
|
||||
link += `pkg-config --libs QtCore QtGui`
|
||||
qtflags = `pkg-config --cflags QtCore QtGui`
|
||||
else ifeq ($(platform),win) # Windows
|
||||
qtdir = c:/qt450
|
||||
|
||||
link += $(call mklibpath,$(qtdir)/lib)
|
||||
link += $(call mklibpath,$(qtdir)/plugins/imageformats)
|
||||
ifeq ($(platform),x)
|
||||
#qtflags = `pkg-config --cflags QtCore QtGui`
|
||||
link += `pkg-config --libs QtCore QtGui`
|
||||
qtflags = -I/Developer/SDKs/Qt/include -I/Developer/SDKs/Qt/include/QtCore -I/Developer/SDKs/Qt/include/QtGui -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -I/Developer/SDKs/Qt/include/QtOpenGL
|
||||
|
||||
link = -F/Developer/SDKs/Qt/lib -L/Developer/SDKs/Qt/lib -framework QtOpenGL -L/Developer/SDKs/Qt/lib -F/Developer/SDKs/Qt/lib -framework QtGui -framework Carbon -framework AppKit -framework QtCore -lz -lm -framework ApplicationServices -framework OpenGL -framework AGL -L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -lXext -lX11 -lz
|
||||
|
||||
link = -F/Developer/SDKs/Qt/lib -L/Developer/SDKs/Qt/lib -framework QtOpenGL -L/Developer/SDKs/Qt/lib -F/Developer/SDKs/Qt/lib -framework QtGui -framework Carbon -framework AppKit -framework QtCore -lz -lm -framework ApplicationServices -framework OpenGL -framework AGL -L/opt/local/lib -lSDL -Wl,-framework,Cocoa -lXext -lX11 -lz -lgl
|
||||
|
||||
|
||||
|
||||
else ifeq ($(platform),win)
|
||||
ifeq ($(qtpath),)
|
||||
# find Qt install directory from PATH environment variable
|
||||
qtpath := $(foreach path,$(subst ;, ,$(PATH)),$(if $(wildcard $(path)/$(moc).exe),$(path)))
|
||||
qtpath := $(strip $(qtpath))
|
||||
qtpath := $(subst \,/,$(qtpath))
|
||||
qtpath := $(patsubst %/bin,%,$(qtpath))
|
||||
endif
|
||||
|
||||
link += $(call mklib,mingw32)
|
||||
link += $(call mklib,qtmain)
|
||||
link += $(call mklib,QtGui)
|
||||
link += $(call mklib,comdlg32)
|
||||
link += $(call mklib,oleaut32)
|
||||
link += $(call mklib,imm32)
|
||||
link += $(call mklib,winmm)
|
||||
link += $(call mklib,winspool)
|
||||
link += $(call mklib,msimg32)
|
||||
link += $(call mklib,QtCore)
|
||||
link += $(call mklib,ole32)
|
||||
link += $(call mklib,advapi32)
|
||||
link += $(call mklib,ws2_32)
|
||||
link += $(call mklib,uuid)
|
||||
link += $(call mklib,gdi32)
|
||||
qtflags := -I$(qtpath)/include
|
||||
qtflags += -I$(qtpath)/include/QtCore
|
||||
qtflags += -I$(qtpath)/include/QtGui
|
||||
|
||||
link += -L$(qtpath)/lib
|
||||
link += -L$(qtpath)/plugins/imageformats
|
||||
|
||||
link += -lmingw32 -lqtmain -lQtGui -lcomdlg32 -loleaut32 -limm32 -lwinmm
|
||||
link += -lwinspool -lmsimg32 -lQtCore -lole32 -ladvapi32 -lws2_32 -luuid -lgdi32
|
||||
|
||||
# optional image-file support:
|
||||
# link += $(call mklib,qjpeg)
|
||||
# link += $(call mklib,qmng)
|
||||
|
||||
qtflags = $(call mkincpath,$(qtdir)/include)
|
||||
qtflags += $(call mkincpath,$(qtdir)/include/QtCore)
|
||||
qtflags += $(call mkincpath,$(qtdir)/include/QtGui)
|
||||
# link += -lqjpeg -lqmng
|
||||
endif
|
||||
|
||||
moc_objects = \
|
||||
$(ui)/base/main.moc \
|
||||
$(ui)/base/loader.moc \
|
||||
$(ui)/base/htmlviewer.moc \
|
||||
$(ui)/base/about.moc \
|
||||
$(ui)/settings/settings.moc \
|
||||
$(ui)/settings/video.moc \
|
||||
$(ui)/settings/audio.moc \
|
||||
$(ui)/settings/input.moc \
|
||||
$(ui)/settings/paths.moc \
|
||||
$(ui)/settings/cheateditor.moc \
|
||||
$(ui)/settings/advanced.moc \
|
||||
$(ui)/settings/utility/inputcapture.moc \
|
||||
$(ui)/settings/utility/codeeditor.moc \
|
||||
moc_headers := $(call rwildcard,$(ui)/,%.mh)
|
||||
moc_objects := $(patsubst %.mh,%.moc,$(moc_headers))
|
||||
|
||||
#############
|
||||
### rules ###
|
||||
#############
|
||||
|
||||
%.moc: $<; $(moc) $(patsubst %.moc,%.hpp,$@) -o $@
|
||||
$(foreach object,$(moc_objects),$(eval $(object): $(patsubst %.moc,%.hpp,$(object))))
|
||||
# automatically run moc on all .mh (.MocHeader) files
|
||||
%.moc: $<; $(moc) -f $< -o $@
|
||||
$(foreach f,$(moc_objects),$(eval $f: $(patsubst %.moc,%.mh,$f)))
|
||||
|
||||
obj/main.$(obj): $(ui)/main.cpp \
|
||||
$(ui)/* $(ui)/input/* $(ui)/utility/* $(ui)/base/* $(ui)/settings/* $(ui)/settings/utility/* \
|
||||
data/*
|
||||
obj/main.o: $(ui)/main.cpp $(call rwildcard,$(ui)/)
|
||||
$(call compile,$(qtflags))
|
||||
|
||||
$(ui)/resource/resource.rcc: $(ui)/resource/resource.qrc data/*
|
||||
$(rcc) $(ui)/resource/resource.qrc -o $(ui)/resource/resource.rcc
|
||||
|
||||
obj/resource.$(obj): $(ui)/resource/resource.rc
|
||||
windres $(ui)/resource/resource.rc obj/resource.$(obj)
|
||||
obj/resource.o: $(ui)/resource/resource.rc
|
||||
windres $(ui)/resource/resource.rc obj/resource.o
|
||||
|
||||
###############
|
||||
### targets ###
|
||||
@@ -96,5 +68,5 @@ obj/resource.$(obj): $(ui)/resource/resource.rc
|
||||
|
||||
ui_build: $(ui)/resource/resource.rcc $(moc_objects);
|
||||
ui_clean:
|
||||
-$(foreach object,$(moc_objects),@$(call delete,$(object)))
|
||||
-$(foreach f,$(moc_objects),@$(call delete,$f))
|
||||
-@$(call delete,$(ui)/resource/resource.rcc)
|
||||
|
||||
Reference in New Issue
Block a user