GNUmakefile.in 2.71 KB
Newer Older
1 2 3 4
#
# Insert Copyright Here.
#
include ../Makeconf
5

Leigh B. Stoller's avatar
Leigh B. Stoller committed
6
SUBDIRS		= checkpass
7
SCRIPTS		= mkprojdir_wrapper tbdoit tbstopit mkexpdir \
8
		  power resetvlans savevlans snmpit tbend \
mac's avatar
mac committed
9
		  tbrun tbprerun tbreport vpower vsnmpit killtip \
10
		  mkacct-ctrl_wrapper rmacct-ctrl_wrapper rmprojdir_wrapper \
mac's avatar
mac committed
11
		  sched_reload os_setup
12 13
SUSCRIPTS	= mkprojdir rmprojdir os_setup  \
	          mkacct-ctrl rmacct-ctrl os_load console_setup
14
SBINSCRIPTS     = console_setup.proxy
15

Leigh B. Stoller's avatar
Leigh B. Stoller committed
16 17
all:	$(BINS) $(SUBDIRS)

18 19
include ../GNUmakerules

Leigh B. Stoller's avatar
Leigh B. Stoller committed
20 21 22
.PHONY:	checkpass
checkpass:
	@$(MAKE) -C checkpass all
23

24 25 26 27 28 29
#
# Currently, all the stuff that gets installed in the bin directory
# gets duplicated in lib/tbsetup.
#
INSTALL_LIBTBDIR = $(INSTALL_LIBDIR)/tbsetup

Leigh B. Stoller's avatar
Leigh B. Stoller committed
30
install: script-install subdir-install
31 32
	@echo "Don't forget to do a post-install as root"

Leigh B. Stoller's avatar
Leigh B. Stoller committed
33 34 35 36 37 38
#
# Automate this part at some point.
# 
subdir-install:
	@$(MAKE) -C checkpass install	
	@$(MAKE) -C ir install	
Leigh B. Stoller's avatar
Leigh B. Stoller committed
39 40 41 42 43
	@$(MAKE) -C ns2ir install

script-install:	$(addprefix $(INSTALL_BINDIR)/, $(SCRIPTS)) \
	 $(addprefix $(INSTALL_BINDIR)/, $(SUSCRIPTS)) \
	 $(addprefix $(INSTALL_LIBTBDIR)/, $(SCRIPTS)) \
44
	 $(addprefix $(INSTALL_LIBTBDIR)/, $(SUSCRIPTS)) \
45
	 $(addprefix $(INSTALL_SBINDIR)/, $(SBINSCRIPTS))
Leigh B. Stoller's avatar
Leigh B. Stoller committed
46

47 48 49 50 51 52 53 54 55 56
#
# Leave these rules here. They should be flushed when we no longer
# dup this stuff.
# 
$(INSTALL_LIBTBDIR)/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_LIBTBDIR)
	$(INSTALL) $< $@

$(INSTALL_LIBTBDIR)/%: %.tcl
57
	@echo "Installing $<"
58
	-mkdir -p $(INSTALL_LIBTBDIR)
59 60 61 62 63
	$(INSTALL) $< $@

post-install: 
	chown root $(INSTALL_BINDIR)/mkprojdir
	chmod u+s $(INSTALL_BINDIR)/mkprojdir
64 65
	chown root $(INSTALL_BINDIR)/rmprojdir
	chmod u+s $(INSTALL_BINDIR)/rmprojdir
66 67
	chown root $(INSTALL_BINDIR)/mkacct-ctrl
	chmod u+s $(INSTALL_BINDIR)/mkacct-ctrl
68 69 70 71 72
	chown root $(INSTALL_LIBTBDIR)/mkacct-ctrl
	chmod u+s $(INSTALL_LIBTBDIR)/mkacct-ctrl
	chown root $(INSTALL_BINDIR)/rmacct-ctrl
	chmod u+s $(INSTALL_BINDIR)/rmacct-ctrl
	chown root $(INSTALL_LIBTBDIR)/rmacct-ctrl
73
	chmod u+s $(INSTALL_LIBTBDIR)/rmacct-ctrl
74 75 76 77
	chown root $(INSTALL_BINDIR)/os_setup
	chmod u+s $(INSTALL_BINDIR)/os_setup
	chown root $(INSTALL_LIBTBDIR)/os_setup
	chmod u+s $(INSTALL_LIBTBDIR)/os_setup
78 79 80 81
	chown root $(INSTALL_BINDIR)/os_load
	chmod u+s $(INSTALL_BINDIR)/os_load
	chown root $(INSTALL_LIBTBDIR)/os_load
	chmod u+s $(INSTALL_LIBTBDIR)/os_load
82 83 84 85
	chown root $(INSTALL_BINDIR)/console_setup
	chmod u+s $(INSTALL_BINDIR)/console_setup
	chown root $(INSTALL_LIBTBDIR)/console_setup
	chmod u+s $(INSTALL_LIBTBDIR)/console_setup
86

87
clean:	subdir-clean
88
	rm -f *.o $(BINS) core
89 90 91 92 93 94 95 96 97 98 99 100

subdir-clean:
	@$(MAKE) -C checkpass clean
	@$(MAKE) -C ir clean
	@$(MAKE) -C ns2ir clean

distclean:	subdir-distclean

subdir-distclean:
	@$(MAKE) -C checkpass distclean
	@$(MAKE) -C ir distclean
	@$(MAKE) -C ns2ir distclean