GNUmakefile.in 2.04 KB
Newer Older
Mike Hibler's avatar
Mike Hibler committed
1
#
2
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
Mike Hibler's avatar
Mike Hibler committed
22 23 24
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
25 26
OBJDIR		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
Mike Hibler's avatar
Mike Hibler committed
27 28 29

CBINDIR		= $(DESTDIR)$(CLIENT_BINDIR)
LBINDIR		= $(DESTDIR)/usr/local/bin
30 31 32 33 34 35 36
IZSRCDIR	= $(TESTBED_SRCDIR)/os/imagezip

#
# XXX should be in sync with imagezip/GNUmakefile
#
WITH_MBR	= 1
WITH_GPT	= 1
Mike Hibler's avatar
Mike Hibler committed
37 38 39

include $(OBJDIR)/Makeconf

40 41 42 43 44 45 46 47 48 49 50
PARTFLAGS	= -I$(IZSRCDIR)
PARTLIBS	=
ifeq ($(WITH_MBR),1)
PARTLIBS	+= $(OBJDIR)/os/imagezip/mbr/libmbr.a
PARTFLAGS	+= -DWITH_MBR
endif
ifeq ($(WITH_GPT),1)
PARTLIBS	+= $(OBJDIR)/os/imagezip/gpt/libgpt.a
PARTFLAGS	+= -DWITH_GPT
endif

Mike Hibler's avatar
Mike Hibler committed
51 52 53 54
all:

include $(TESTBED_SRCDIR)/GNUmakerules

55
CFLAGS		= -O -g $(LDSTATIC) $(PARTFLAGS)
Mike Hibler's avatar
Mike Hibler committed
56

57 58
zapdisk: zapdisk.o disksize.o $(PARTLIBS)
	$(CC) $(CFLAGS) zapdisk.o disksize.o $(PARTLIBS) -o zapdisk
Mike Hibler's avatar
Mike Hibler committed
59 60 61
	cp zapdisk zapdisk.debug
	strip zapdisk

62 63 64 65 66 67
disksize.o:	$(IZSRCDIR)/disksize.c
	$(CC) -c $(CFLAGS) -o disksize.o $<

$(PARTLIBS):
	@$(MAKE) -C $(OBJDIR)/os/imagezip partlibs

Mike Hibler's avatar
Mike Hibler committed
68 69
install:

70
mfs frisbee-mfs: zapdisk
Mike Hibler's avatar
Mike Hibler committed
71 72 73 74 75

mfs-install: mfs
	$(INSTALL_PROGRAM) -m 700 -s zapdisk$(EXE) $(CBINDIR)/zapdisk$(EXE)
	$(INSTALL_PROGRAM) -m 700 $(SRCDIR)/diskzap $(LBINDIR)/diskzap

76 77 78
frisbee-mfs-install: frisbee-mfs
	$(INSTALL_PROGRAM) -m 700 -s zapdisk$(EXE) $(CBINDIR)/zapdisk$(EXE)

Mike Hibler's avatar
Mike Hibler committed
79 80
clean:
	rm -f *.o zapdisk zapdisk.debug