defs.mk, exe.mk, rules.mk: Add support for .qrc qt resource files

This commit is contained in:
Jan Lindemann 2005-05-01 02:27:13 +00:00 committed by Jan Lindemann
commit 7afa6c758b
3 changed files with 13 additions and 2 deletions

View file

@ -43,6 +43,7 @@ MKFILES = $(wildcard *.mk)
CFILES = $(wildcard *.c)
CPPFILES = $(wildcard *.cc *.cpp)
UIFILES = $(wildcard *.ui)
RCCFILES = $(wildcard *.qrc)
CALLSRC = $(CFILES) $(CPPFILES)
OBJ = $(patsubst %.cpp,%.o,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(CALLSRC))))
SHOBJS = $(patsubst %.cpp,lib%.so,$(patsubst %.cc,lib%.so,$(patsubst %.c,lib%.so,$(CALLSRC))))
@ -164,6 +165,7 @@ LD_LIB_PATH += $(QT_PREFIX)/lib
MOC = $(QT_PREFIX)/bin/moc
UIC = $(QT_PREFIX)/bin/uic
RCC = $(QT_PREFIX)/bin/rcc
ifneq ($(wildcard *.h),)
MOC_H_HC = $(shell grep -H Q_OBJECT $(wildcard *.h) | cut -d: -f1 | sort -u)
@ -171,11 +173,13 @@ endif
MOC_H_UI = $(patsubst %.ui,%.h,$(UIFILES))
MOC_H = $(sort $(MOC_H_HC) $(MOC_H_UI))
MOC_CPP = $(patsubst %.h,moc_%.cpp, $(MOC_H))
RCC_CPP = $(patsubst %.qrc,rcc_%.cpp, $(RCCFILES))
UIC_H = $(patsubst %.ui,%.h, $(UIFILES))
UIC_CPP = $(patsubst %.ui,uic_%.cpp, $(UIFILES))
OBJ += $(patsubst %.cpp,%.o,$(MOC_CPP))
OBJ += $(patsubst %.cpp,%.o,$(UIC_CPP))
OBJ += $(patsubst %.cpp,%.o,$(RCC_CPP))
ifdef REENTRANT
LPPFLAGS += -L$(QT_PREFIX)/lib -lqt-mt
@ -312,3 +316,4 @@ endif
ifneq ($(wildcard local.mk),)
include local.mk
endif

View file

@ -20,5 +20,5 @@ strace: $(EXE) $(EXE_BIN)
$(EXPORT_LD_LIB_PATH); strace -f ./$(EXE) $(EXE_ARGS)
kdbg gdb ddd:
rm -f $(CORE); make run; $@ $(EXE) $(firstword $(CORE))
clean: execlean localclean mocclean uicclean
clean: execlean localclean mocclean uicclean rccclean

View file

@ -28,6 +28,9 @@ $(LIBDIR):
moc_%.cpp: %.h
$(MOC) -o $@ $<
rcc_%.cpp: %.qrc
$(RCC) -o $@ $<
%.h: %.ui
$(UIC) $< -o $@
@ -68,7 +71,7 @@ timers_%.h: %.h $(GENERATE_FUNC_TIMERS)
sh $(GENERATE_FUNC_TIMERS) $< $@
ifneq ($(USE_QT),)
$(OBJ): $(UIC_H) $(MOC_H) $(UIC_CPP) $(MOC_CPP)
$(OBJ): $(UIC_H) $(MOC_H) $(UIC_CPP) $(MOC_CPP) $(RCC_CPP)
endif
ifeq ($(USE_PROJECT_LIB),true)
@ -186,6 +189,9 @@ mocclean:
uicclean:
rm -rf $(UIC_CPP) $(UIC_H)
rccclean:
rm -rf $(RCC_CPP)
textclean: doneclean
rm -rf $(TEXTCLEAN) \#*\# .kdbgrc.* .\#*