Remove Makefile. Replace with Rakefile.
This commit is contained in:
parent
ff5701250e
commit
457fec514e
2 changed files with 25 additions and 191 deletions
166
Makefile
166
Makefile
|
@ -1,166 +0,0 @@
|
|||
|
||||
NAME=qasim
|
||||
DESTDIR=
|
||||
DEV_DESTDIR=tmp
|
||||
CONFDIR=$(DESTDIR)/etc
|
||||
BINDIR=$(DESTDIR)/usr/bin
|
||||
MANDIR=$(DESTDIR)/usr/share/man
|
||||
DOCDIR=$(DESTDIR)/usr/share/doc
|
||||
SHAREDIR=$(DESTDIR)/usr/share
|
||||
|
||||
RUBYVERSION=2.0
|
||||
RDOC=rdoc$(RUBYVERSION)
|
||||
|
||||
all: \
|
||||
build \
|
||||
install
|
||||
|
||||
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
|
||||
|
||||
install: \
|
||||
install-ui \
|
||||
install-qrc \
|
||||
install-bin \
|
||||
install-lib \
|
||||
install-data
|
||||
|
||||
## DOC SECTION
|
||||
|
||||
install-doc:
|
||||
# # install documentation
|
||||
rm -fr $(DOCDIR)/$(NAME)
|
||||
mkdir -p $(DOCDIR)/$(NAME)
|
||||
cp -a doc $(DOCDIR)/$(NAME)
|
||||
|
||||
|
||||
## 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 $< -o $@
|
||||
sed -e '/^module Ui/,/^end # module Ui/d' \
|
||||
-i $@
|
||||
|
||||
|
||||
## BINARY SECTION
|
||||
|
||||
clean-bin:
|
||||
# remove external packages
|
||||
rm -fr vendor/bundle
|
||||
|
||||
build-bin:
|
||||
|
||||
install-bin:
|
||||
env |sort
|
||||
mkdir -p $(BINDIR)
|
||||
for binfile in bin/*.rb ; do \
|
||||
BINFILE=`basename $$binfile |sed -e 's/.rb$$//'`; \
|
||||
install -D -o root -g root -m 755 $$binfile $(BINDIR)/$$BINFILE; \
|
||||
sed -i -e 's|^QASIM_INCLUDE_DIR.*|QASIM_INCLUDE_DIR = "$(SHAREDIR)/$(NAME)/lib"|' $(BINDIR)/$$BINFILE; \
|
||||
sed -i -e 's|^QASIM_DATA_DIR.*|QASIM_DATA_DIR = "$(SHAREDIR)/$(NAME)"|' $(BINDIR)/$$BINFILE; \
|
||||
done
|
||||
#install -D -o root -g root -m 755 $(CURDIR)/bin/$(NAME)-gui.rb $(BINDIR)/$(NAME)-gui
|
||||
|
||||
## LIB SECTION
|
||||
|
||||
clean-lib:
|
||||
|
||||
build-lib:
|
||||
|
||||
install-lib:
|
||||
IFS="" find lib -name '*.rb' | while read libfile ; do \
|
||||
install -D -o root -g root -m 644 $$libfile $(SHAREDIR)/$(NAME)/$$libfile; \
|
||||
done
|
||||
|
||||
|
||||
## DATA SECTION
|
||||
|
||||
clean-data:
|
||||
|
||||
build-data:
|
||||
|
||||
install-data:
|
||||
## Install man pages
|
||||
mkdir -p $(MANDIR)/man1
|
||||
for binfile in bin/*.rb ; do \
|
||||
BINFILE=`basename $$binfile |sed -e 's/.rb$$//'`; \
|
||||
cat man/$${BINFILE}.1 | gzip > $(MANDIR)/man1/$${BINFILE}.1.gz ; \
|
||||
done
|
||||
#
|
||||
## Install icons
|
||||
mkdir -p $(SHAREDIR)/$(NAME)/icons
|
||||
install -D -o root -g root -m 644 $(CURDIR)/data/icons/$(NAME).svg \
|
||||
$(SHAREDIR)/$(NAME)/icons/$(NAME).svg
|
||||
#
|
||||
## Install completion file
|
||||
# install -D -o root -g root -m 644 $(CURDIR)/$(NAME).completion $(DESTDIR)/etc/bash_completion.d/$(NAME)
|
||||
#
|
||||
## Install configuration files
|
||||
mkdir -p $(CONFDIR)/xdg/autostart
|
||||
install -D -o root -g root -m 644 $(CURDIR)/conf/$(NAME).desktop \
|
||||
$(CONFDIR)/xdg/autostart/$(NAME).desktop
|
||||
install -D -o root -g root -m 644 $(CURDIR)/conf/$(NAME).desktop \
|
||||
$(SHAREDIR)/applications/$(NAME).desktop
|
||||
mkdir -p $(CONFDIR)/$(NAME)
|
||||
install -D -o root -g root -m 644 $(CURDIR)/conf/config \
|
||||
$(CONFDIR)/$(NAME)/config
|
||||
install -D -o root -g root -m 644 $(CURDIR)/conf/default.map \
|
||||
$(CONFDIR)/$(NAME)/default.map
|
||||
#
|
||||
# Install examples
|
||||
mkdir -p $(DOCDIR)/$(NAME)/examples
|
||||
for f in `ls examples`; do \
|
||||
cat examples/$$f | gzip -f9 > $(DOCDIR)/$(NAME)/examples/$$f.gz ; \
|
||||
done
|
||||
|
||||
|
||||
## OTHER
|
||||
|
||||
.PHONY: destdir
|
||||
dev-install:
|
||||
rm -fr $(DEV_DESTDIR)
|
||||
fakeroot $(MAKE) install DESTDIR=$(DEV_DESTDIR)
|
||||
|
46
Rakefile
46
Rakefile
|
@ -13,6 +13,7 @@ RDOC="rdoc#{RUBYVERSION}"
|
|||
|
||||
QRC_FILES=Dir.glob("lib/#{NAME}/*.qrc")
|
||||
RBQRC_FILES=QRC_FILES.map{ |f| f.sub(/\.qrc$/,'_qrc.rb') }
|
||||
RBQRC_TO_QRC = lambda{|f| f.gsub(/_qrc\.rb/,'.qrc') }
|
||||
|
||||
UI_FILES=Dir.glob("lib/#{NAME}/ui/*.ui")
|
||||
RBUI_FILES=UI_FILES.map{ |f| f.sub(/\.ui$/,'_ui.rb') }
|
||||
|
@ -21,16 +22,13 @@ require 'rake'
|
|||
#Rake.application.options.trace_rules = true
|
||||
|
||||
|
||||
desc "Do everything"
|
||||
task :all => [:build, :install]
|
||||
desc "Default task (build)"
|
||||
task :all => :build
|
||||
|
||||
desc "Clean everything"
|
||||
task :clean => [
|
||||
:"ui:clean",
|
||||
:"qrc:clean",
|
||||
#:clean_bin,
|
||||
#:clean_lib,
|
||||
#:clean_data,
|
||||
:"gem:clean"
|
||||
]
|
||||
|
||||
|
@ -38,38 +36,38 @@ desc "Build everything"
|
|||
task :build => [
|
||||
:"ui:build",
|
||||
:"qrc:build",
|
||||
#:build_bin,
|
||||
#:build_lib,
|
||||
#:build_data,
|
||||
:"doc:build",
|
||||
:"gem:build"
|
||||
]
|
||||
|
||||
desc "Install everything"
|
||||
task :install => [
|
||||
#:"ui:install",
|
||||
#:"qrc:install",
|
||||
#:install_bin,
|
||||
#:install_lib,
|
||||
#:install_data
|
||||
]
|
||||
|
||||
desc "Build documentation"
|
||||
task :doc => [:build_doc]
|
||||
namespace :data do
|
||||
task :build do
|
||||
end
|
||||
|
||||
task :clean_doc do
|
||||
rm_rf doc
|
||||
task :clean do
|
||||
end
|
||||
end
|
||||
|
||||
task :build_doc => :clean_doc do
|
||||
|
||||
namespace :doc do
|
||||
task :clean do
|
||||
rm_rf "doc"
|
||||
end
|
||||
|
||||
task :build => :clean do
|
||||
sh %Q{#{RDOC}
|
||||
--promiscuous
|
||||
--inline-source
|
||||
--line-numbers
|
||||
-o doc lib/$(NAME)/
|
||||
-o doc
|
||||
lib/#{NAME}/
|
||||
bin/
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
namespace :qrc do
|
||||
desc "Clean QRC files"
|
||||
task :clean do
|
||||
|
@ -81,11 +79,12 @@ namespace :qrc do
|
|||
puts RBQRC_FILES
|
||||
end
|
||||
|
||||
rule "_qrc.rb" => lambda{|f| f.gsub(/_qrc\.rb/,'.qrc') } do |t|
|
||||
rule "_qrc.rb" => RBQRC_TO_QRC do |t|
|
||||
sh %Q{rbrcc #{t.source} -o #{t.name}}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
namespace :ui do
|
||||
desc "Clean UI files"
|
||||
task :clean do
|
||||
|
@ -113,6 +112,7 @@ namespace :gem do
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
require "bundler/gem_tasks"
|
||||
require 'rake/testtask'
|
||||
|
||||
|
|
Loading…
Reference in a new issue