GNUmakefile 1.55 KB
Newer Older
1 2 3 4 5
#
# Insert Copyright Here.
#
include ../Makeconf
include ../GNUmakerules
6

Leigh B. Stoller's avatar
Leigh B. Stoller committed
7
SUBDIRS		= checkpass
8 9 10
SCRIPTS		= mkprojdir_wrapper tbdoit tbstopit mkexpdir \
		  mkacct rmacct delay_setup ifc_setup ifc_filegen \
		  ir2ifc power resetvlans savevlans snmpit tbend \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
11 12
		  tbprerun tbreport vpower vsnmpit killtip
DATAFILES	= default.ifc
13
SUSCRIPTS	= mkprojdir os_setup
14

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

.PHONY:	checkpass
checkpass:
	@$(MAKE) -C checkpass all
20

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

27
install: $(addprefix $(INSTALL_BINDIR)/, $(SCRIPTS)) \
28 29
	 $(addprefix $(INSTALL_BINDIR)/, $(SUSCRIPTS)) \
	 $(addprefix $(INSTALL_LIBTBDIR)/, $(SCRIPTS)) \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
30 31
	 $(addprefix $(INSTALL_LIBTBDIR)/, $(DATAFILES)) \
	 subdir-install
32 33
	@echo "Don't forget to do a post-install as root"

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

42 43 44 45 46 47 48 49 50 51
#
# 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
52
	@echo "Installing $<"
53
	-mkdir -p $(INSTALL_LIBTBDIR)
54 55 56 57 58
	$(INSTALL) $< $@

post-install: 
	chown root $(INSTALL_BINDIR)/mkprojdir
	chmod u+s $(INSTALL_BINDIR)/mkprojdir
59 60 61 62
	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
63 64 65

clean:
	rm -f *.o $(BINS) core