Commit 63c9534a authored by Leigh Stoller's avatar Leigh Stoller

Lots more Makefile whacking. I think we are close to a proper install.

parent 901ee10b
...@@ -11,3 +11,8 @@ $(INSTALL_BINDIR)/%: %.tcl ...@@ -11,3 +11,8 @@ $(INSTALL_BINDIR)/%: %.tcl
-mkdir -p $(INSTALL_BINDIR) -mkdir -p $(INSTALL_BINDIR)
$(INSTALL) $< $@ $(INSTALL) $< $@
@echo "Installing $<"
-mkdir -p $(INSTALL_LIBDIR)
$(INSTALL) $< $@
# Testbed wide makefile. # Testbed wide makefile.
.PHONY: all lib/ assign/assign SUBDIRS = lib assign discvr tbsetup db os security
install: all: all-subdirs
@echo "Is Leigh going to yell at you for doing this?" install: all
@echo "Did you remember to do a cvs update?" install: install-subdirs
@$(MAKE) -C tbsetup post-install
@$(MAKE) -C security post-install
install-ifyoudare: all install-ifyoudare: all
install -c assign/assign /usr/testbed/bin
install -c db/avail /usr/testbed/bin
install -c db/inuse /usr/testbed/bin
install -c db/mac2if /usr/testbed/bin
install -c db/nalloc /usr/testbed/bin
install -c db/nfree /usr/testbed/bin
install -c db/nodeip /usr/testbed/bin
install -c db/ptopgen /usr/testbed/bin
install -c db/showgraph /usr/testbed/bin
install -c db/tblog /usr/testbed/bin
install -c discvr/cli /usr/testbed/bin
install -c discvr/serv /usr/testbed/bin
# XXXThese don't work anymore # XXXThese don't work anymore
#install -c os/gethostkey.tcl /usr/testbed/bin/gethostkey #install -c os/gethostkey.tcl /usr/testbed/bin/gethostkey
#install -c os/hostkey.tcl /usr/testbed/bin/hostkey #install -c os/hostkey.tcl /usr/testbed/bin/hostkey
...@@ -37,62 +25,14 @@ install-ifyoudare: all ...@@ -37,62 +25,14 @@ install-ifyoudare: all
#install -c os/ /usr/testbed/bin/setupmachine #install -c os/ /usr/testbed/bin/setupmachine
#install -c os/imagezip/imagezip /usr/testbed/bin/imagezip #install -c os/imagezip/imagezip /usr/testbed/bin/imagezip
# XXX # How to recursively descend into subdirectories to make general
install -c os/oslib.tcl /usr/testbed/bin # targets such as `all'.
install -c tbsetup/mkacct /usr/testbed/bin @$(MAKE) -C $(dir $@) $(basename $(notdir $@))
install -c tbsetup/rmacct /usr/testbed/bin %-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
install -c tbsetup/genptop /usr/testbed/bin
install -c tbsetup/delay_setup /usr/testbed/bin
install -c tbsetup/ifc_setup /usr/testbed/bin
install -c tbsetup/ifc_filegen /usr/testbed/bin
install -c tbsetup/ir2ifc /usr/testbed/bin
install -c tbsetup/power /usr/testbed/bin
install -c tbsetup/resetvlans.tcl /usr/testbed/bin/resetvlans
install -c tbsetup/savevlans /usr/testbed/bin
install -c tbsetup/snmpit /usr/testbed/bin
install -c tbsetup/tbend.tcl /usr/testbed/bin/tbend
install -c tbsetup/tbprerun.tcl /usr/testbed/bin/tbprerun
install -c tbsetup/tbreport.tcl /usr/testbed/bin/tbreport
install -c tbsetup/tbrun.tcl /usr/testbed/bin/tbrun
install -c tbsetup/vpower /usr/testbed/bin
install -c tbsetup/vsnmpit /usr/testbed/bin
install -c tbsetup/tbdoit /usr/testbed/bin
install -c tbsetup/tbstopit /usr/testbed/bin
#XXX - hackish
rm -rf /usr/testbed/lib/tbsetup
rm -rf /usr/testbed/lib/db
cp -rf tbsetup /usr/testbed/lib/tbsetup
cp -rf db /usr/testbed/lib/db
install -c assign/assign /usr/testbed/lib/assign
@$(MAKE) -C tbsetup/checkpass install
all: lib/ assign/assign discvr/cli discvr/serv os/key7 os/key8 os/imagezip/imagezip tbsetup/checkpass/checkpass
@$(MAKE) -C lib
@$(MAKE) -C assign assign
discvr/cli: # By default, make any target by descending into subdirectories.
@$(MAKE) -C discvr cli %: %-subdirs ;
@$(MAKE) -C discvr serv
@$(MAKE) -C os key7
@$(MAKE) -C os key8
@$(MAKE) -C os/imagezip imagezip
@$(MAKE) -C tbsetup/checkpass checkpass
clean: clean:
@$(MAKE) -C assign clean @$(MAKE) -C assign clean
...@@ -100,3 +40,8 @@ clean: ...@@ -100,3 +40,8 @@ clean:
@$(MAKE) -C os clean @$(MAKE) -C os clean
@$(MAKE) -C os/imagezip clean @$(MAKE) -C os/imagezip clean
@$(MAKE) -C tbsetup/checkpass clean @$(MAKE) -C tbsetup/checkpass clean
.PHONY: post-install
# Get rid of a bunch of nasty built-in implicit rules.
# Insert Copyright Here.
include ../Makeconf
include ../GNUmakerules
CXX=/usr/gnu/bin/g++ CXX=/usr/gnu/bin/g++
CC=/usr/gnu/bin/gcc CC=/usr/gnu/bin/gcc
LEDA=/n/paria/z/dga/LEDA-4.0 LEDA=/n/paria/z/dga/LEDA-4.0
...@@ -21,6 +27,8 @@ assign_p: assign.po $(DEPLIBS) $(POBJS) ...@@ -21,6 +27,8 @@ assign_p: assign.po $(DEPLIBS) $(POBJS)
assign.po: assign.po:
${CXX} -c -pg -g -o assign.po ${CXXFLAGS} ${CXX} -c -pg -g -o assign.po ${CXXFLAGS}
install: $(INSTALL_BINDIR)/assign $(INSTALL_LIBDIR)/assign
clean: clean:
/bin/rm -f *.o assign /bin/rm -f *.o assign
# Insert Copyright Here.
include ../Makeconf
include ../GNUmakerules
BINSCRIPTS = avail inuse mac2if nalloc nfree nodeip ptopgen \
showgraph tblog
ALLSCRIPTS = dbupdate usrud approve grpmemb user checkowner.tcl usrmod \
# Currently, all the stuff that gets installed in the bin directory
# gets duplicated in lib/tbsetup.
install: $(addprefix $(INSTALL_BINDIR)/, $(BINSCRIPTS)) \
# Leave these rules here. They should be flushed when we no longer
# dup this stuff.
@echo "Installing $<"
$(INSTALL) $< $@
# Insert Copyright Here.
include ../Makeconf
include ../GNUmakerules
OBJS=get_ifi_info.o get_rtaddrs.o net_rt_iflist.o sock_ntop.o util.o OBJS=get_ifi_info.o get_rtaddrs.o net_rt_iflist.o sock_ntop.o util.o
SOBJS=serv_listen.o recvfromflags.o if_indextoname.o reply.o serv.o forw_requests.o SOBJS=serv_listen.o recvfromflags.o if_indextoname.o reply.o serv.o forw_requests.o
COBJS=cli.o COBJS=cli.o
...@@ -13,5 +19,7 @@ cli: ${OBJS} ${COBJS} ...@@ -13,5 +19,7 @@ cli: ${OBJS} ${COBJS}
serv: ${OBJS} ${SOBJS} serv: ${OBJS} ${SOBJS}
$(CC) $(OBJS) $(SOBJS) ${LIBS} -o serv $(CC) $(OBJS) $(SOBJS) ${LIBS} -o serv
install: all $(INSTALL_BINDIR)/cli $(INSTALL_BINDIR)/serv
clean: clean:
/bin/rm -rf $(OBJS) $(SOBJS) $(COBJS) cli serv /bin/rm -rf $(OBJS) $(SOBJS) $(COBJS) cli serv
\ No newline at end of file
# Insert Copyright Here.
include ../Makeconf
include ../GNUmakerules
all: all:
./ ./
install: all $(INSTALL_LIBDIR)/
# Insert Copyright Here.
include ../Makeconf
include ../GNUmakerules
CC=gcc CC=gcc
all: key7 key8 SCRIPTS = oslib.tcl
key7: key7.c key7: key7.c
$(CC) $(CFLAGS) -o key7 key7.c $(CC) $(CFLAGS) -o key7 key7.c
...@@ -9,5 +17,7 @@ key7: key7.c ...@@ -9,5 +17,7 @@ key7: key7.c
key8: key8.c key8: key8.c
$(CC) $(CFLAGS) -o key8 key8.c $(CC) $(CFLAGS) -o key8 key8.c
install: $(addprefix $(INSTALL_BINDIR)/, $(SCRIPTS))
clean: clean:
/bin/rm -f *.o key7 key8 /bin/rm -f *.o key7 key8
# Insert Copyright Here.
include ../Makeconf
include ../GNUmakerules
BINS = suexec BINS = suexec
SCRIPTS = paperbag plasticwrap SCRIPTS = paperbag plasticwrap
CFLAGS = -O -g CFLAGS = -O -g
INSTALL = install -c
INSTALL_BINDIR = /usr/testbed/bin
all: $(BINS) all: $(BINS)
...@@ -13,11 +17,6 @@ suexec: suexec.c suexec.h ...@@ -13,11 +17,6 @@ suexec: suexec.c suexec.h
install: $(addprefix $(INSTALL_BINDIR)/, $(BINS)) install: $(addprefix $(INSTALL_BINDIR)/, $(BINS))
@echo "Don't forget to do a post-install as root" @echo "Don't forget to do a post-install as root"
@echo "Installing $<"
-mkdir -p $(INSTALL_BINDIR)
$(INSTALL) $< $@
post-install: post-install:
chown root $(INSTALL_BINDIR)/suexec chown root $(INSTALL_BINDIR)/suexec
chmod u+s $(INSTALL_BINDIR)/suexec chmod u+s $(INSTALL_BINDIR)/suexec
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment