Makefile 1.2 KB
Newer Older
1 2 3 4 5
#
# Makefile
#
SHELL = /bin/sh
RUBY = ruby
6
FRUBY = ruby
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
RM = rm
#### Start of system configuration section. ####
prefix = $(DESTDIR)/usr
bindir = $(prefix)/bin
libdir = $(prefix)/lib/ruby/$(shell $(RUBY) -rrbconfig -e 'puts Config::CONFIG["ruby_version"]')
mandir = $(DESTDIR)/usr/share/man
bins = $(wildcard bin/*)
libs = $(wildcard lib/*.rb)
libs_debian = $(wildcard lib/debian/*.rb)
man1 = $(wildcard man/*.1)

all:
clean:
	@-(cd t; rm -f test.log)
distclean:	clean
realclean:	distclean

install:
25 26
	@$(FRUBY) -r ftools -e 'File::makedirs(*ARGV)' $(bindir)
	@$(FRUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir)
27
	@for b in $(bins); do \
28
	 $(FRUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0755, true)' \
29 30 31
		$$b $(bindir); \
	done
	@for rb in $(libs); do \
32
	 $(FRUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)'\
33 34 35 36
		 $$rb $(libdir); \
	done
	@mkdir $(libdir)/debian/
	@for rb in $(libs_debian); do \
37
	 $(FRUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)'\
38 39 40 41
		 $$rb $(libdir)/debian; \
	done
	@mkdir -p $(mandir)/man1
	@for m in $(man1); do \
42
	 $(FRUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' \
43 44 45 46 47
		$$m $(mandir)/man1; \
	done

test:
	@(cd t; $(RUBY) testall.rb -o test.log)