File: Makefile

package info (click to toggle)
moomps 4.6-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,444 kB
  • ctags: 2,307
  • sloc: tcl: 34,882; sh: 167; makefile: 91
file content (70 lines) | stat: -rw-r--r-- 2,206 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# $Id: moomps.mk,v 1.2 2004/01/18 23:14:30 jfontain Exp $


VERSION = 4.6

# note: TCLSH and WISH must include path as they are used
# as shell interpreters inside scripts (using the #! syntax)
TCLSH = /usr/bin/tclsh

# only use as the temporary installation directory, such as from a rpm
# specification file, otherwise change the directories below instead:
ROOTDIR =

# you may change the directories below:
BASEDIR =
LIBDIR = $(BASEDIR)/usr/lib
SBINDIR = $(BASEDIR)/usr/sbin
ETCDIR = $(BASEDIR)/etc
INITDIR = $(BASEDIR)/etc/rc.d/init.d
MANDIR = $(BASEDIR)/usr/share/man
DOCDIR = $(BASEDIR)/usr/share/doc
MOODSSLIBDIR = $(LIBDIR)/moodss
# where the modules will be finally installed (useful in rpm specification):
MODULESDIR = $(MOODSSLIBDIR)
MOOMPSDOCDIR = $(DOCDIR)/moomps-$(VERSION)
MOOMPSHTMLDIR = $(MOOMPSDOCDIR)
MOOMPSRCFILE = $(ETCDIR)/moomps/rc


### You should not need to change anything below this line ###
###    (let me know at jfontain@free.fr if you have to)    ###

all: moomps

install:
	mkdir -p $(ROOTDIR)$(SBINDIR)
	mkdir -p $(ROOTDIR)$(ETCDIR)/moomps
	mkdir -p $(ROOTDIR)$(INITDIR)
	mkdir -p $(ROOTDIR)$(MANDIR)/man1
	mkdir -p $(ROOTDIR)$(MOOMPSDOCDIR)
	# append final modules directory to Tcl automatic package path:
	sed -e 's,$$::tcl_library/moodss,$(MODULESDIR),;' moomps > $(ROOTDIR)$(SBINDIR)/moomps
	chmod 755 $(ROOTDIR)$(SBINDIR)/moomps
	cp -f moomps.sh $(ROOTDIR)$(INITDIR)/moomps
	# possibly generate an empty but valid XML resources file with the proper attributes:
	if [ ! -f $(ROOTDIR)$(MOOMPSRCFILE) ]; then\
		echo -e '<?xml version="1.0"?>\n<!DOCTYPE moompsPreferences>\n\n<moompsPreferences></moompsPreferences>' >\
			$(ROOTDIR)$(MOOMPSRCFILE);\
		chmod 600 $(ROOTDIR)$(MOOMPSRCFILE);\
	fi
	cp -f documentation/moomps.1 $(ROOTDIR)$(MANDIR)/man1/
	cd documentation;\
		cp -f COPYRIGHT moomps.htm $(ROOTDIR)$(MOOMPSDOCDIR)/;\
	cd ..


clean:
	rm -f moomps

# combine all source into a single Tcl code file:
moomps:
	rm -f $@
	echo '#!$(TCLSH)' > $@
	$(TCLSH) source.tcl -d 1 moomps.tcl >> $@
	sed\
		-e 's/if {\[catch {package require stooop.*/if 1 {/;'\
		-e 's/if {\[catch {package require switched.*/if 1 {/;'\
		$@ > moomps.tmp
	mv -f moomps.tmp $@
	chmod 755 $@