Makefile: Updates for UI & QRC.

This commit is contained in:
Glenn Y. Rolland 2012-07-28 16:34:35 +02:00
parent 722e78db3a
commit dee06335d6

View file

@ -9,26 +9,49 @@ SHAREDIR=$(DESTDIR)/usr/share
RUBYVERSION=1.8 RUBYVERSION=1.8
RDOC=rdoc$(RUBYVERSION) RDOC=rdoc$(RUBYVERSION)
all: all: \
$(MAKE) -C $(NAME) build \
install
clean: clean: \
$(MAKE) -C $(NAME) clean clean-ui \
clean-qrc \
clean-bin \
clean-lib \
clean-data \
clean-doc
build: \
build-ui \
build-qrc \
build-bin \
build-lib \
build-data
doc: build-doc doc: build-doc
install: \
install-ui \
install-qrc \
install-bin \
install-lib \
install-data
## DOC SECTION
.PHONY: build-doc .PHONY: build-doc
build-doc: clean-doc:
rm -fr doc rm -fr doc
build-doc: clean-doc
$(RDOC) \ $(RDOC) \
--promiscuous \ --promiscuous \
--inline-source \ --inline-source \
--line-numbers \ --line-numbers \
-o doc $(NAME)/ \ -o doc lib/$(NAME)/ \
bin/ bin/
# --diagram # --diagram
#
install-doc: install-doc:
# # install documentation # # install documentation
@ -37,7 +60,45 @@ install-doc:
cp -a doc $(DOCDIR)/$(NAME) cp -a doc $(DOCDIR)/$(NAME)
install: install-bin install-lib install-data ## QRC -> QRC_RB SECTION
QRC_FILES=$(wildcard lib/$(NAME)/*.qrc)
RBQRC_FILES=$(patsubst %.qrc,%_qrc.rb,$(QRC_FILES))
clean-qrc:
rm -f $(RBQRC_FILES)
build-qrc: $(RBQRC_FILES)
echo $(RBQRC_FILES)
install-qrc: $(RBQRC_FILES)
# FIXME install qrc
%_qrc.rb: %.qrc
rbrcc $< -o $@
## UI -> UI_RB SECTION
UI_FILES=$(wildcard lib/$(NAME)/ui/*.ui)
RBUI_FILES=$(patsubst %.ui,%_ui.rb,$(UI_FILES))
clean-ui:
rm -f $(RBUI_FILES)
build-ui: $(RBUI_FILES)
echo $(RBUI_FILES)
install-ui: $(RBUI_FILES)
# FIXME install
%_ui.rb: %.ui
rbuic4 -x $< -o $@
## BINARY SECTION
clean-bin:
# make no sense in ruby
install-bin: install-bin:
mkdir -p $(BINDIR) mkdir -p $(BINDIR)
@ -49,11 +110,21 @@ install-bin:
done done
#install -D -o root -g root -m 755 $(CURDIR)/bin/$(NAME)-gui.rb $(BINDIR)/$(NAME)-gui #install -D -o root -g root -m 755 $(CURDIR)/bin/$(NAME)-gui.rb $(BINDIR)/$(NAME)-gui
## LIB SECTION
clean-lib:
# make no sense in ruby
install-lib: install-lib:
for libfile in $(NAME)/*.rb ; do \ for libfile in $(NAME)/*.rb ; do \
install -D -o root -g root -m 644 $$libfile $(SHAREDIR)/$(NAME)/$$libfile; \ install -D -o root -g root -m 644 $$libfile $(SHAREDIR)/$(NAME)/$$libfile; \
done done
## DATA SECTION
clean-data:
install-data: install-data:
## Install man pages ## Install man pages
# mkdir -p $(MANDIR)/man1 # mkdir -p $(MANDIR)/man1
@ -85,6 +156,9 @@ install-data:
cat examples/$$f | gzip -f9 > $(DOCDIR)/$(NAME)/examples/$$f.gz ; \ cat examples/$$f | gzip -f9 > $(DOCDIR)/$(NAME)/examples/$$f.gz ; \
done done
## OTHER
.PHONY: destdir .PHONY: destdir
destdir: destdir:
rm -fr destdir rm -fr destdir