GNUmakefile.in 1.77 KB
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
1 2
#
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
4 5 6
# All rights reserved.
#

7 8 9
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ../..
10
SUBDIR		= os/imagezip
11

12 13
WITH_NTFS	= @WINSUPPORT@

14
include $(OBJDIR)/Makeconf
15

16 17 18 19
PTHREADCFLAGS	= -D_THREAD_SAFE \
		  -I/usr/local/include/pthread/linuxthreads
PTHREADLIBS	= -L/usr/local/lib -llthread -llgcc_r

Mike Hibler's avatar
all:  
Mike Hibler committed
20
CFLAGS		= -Wall -O2 -g -static
21 22 23
LIBS 		= -lz $(PTHREADLIBS)
UNZIPCFLAGS	= $(CFLAGS) $(PTHREADCFLAGS) -Wall
UNZIPLIBS	= $(LIBS) $(PTHREADLIBS)
24 25 26 27 28 29 30 31 32 33 34 35

# with NTFS
ifeq ($(WITH_NTFS),1)
CC		= gcc30
INCS		= -I$(SRCDIR)/ntfs/extra_bsd_includes \
		  -I$(SRCDIR)/ntfs/linux-ntfs/include \
		  -Intfs/linux-ntfs -I$(SRCDIR)
CFLAGS		+= -DWITH_NTFS $(INCS)
LIBS		+= -Lntfs -lntfs
NTFSDIR		= ntfs
endif

36
all:	imagezip imageunzip imagedump
37

38
include $(TESTBED_SRCDIR)/GNUmakerules
Leigh B. Stoller's avatar
Leigh B. Stoller committed
39

40 41
imagezip: $(NTFSDIR) imagezip.o version.o 
	$(CC) $(CFLAGS) imagezip.o version.o $(LIBS) -o imagezip
Mac Newbold's avatar
Mac Newbold committed
42

43
imageunzip: imageunzip.o version.o 
44 45 46 47
	$(CC) $(CFLAGS) imageunzip.o version.o $(UNZIPLIBS) -o imageunzip

imageunzip.o:	imageunzip.c
	$(CC) -c $(UNZIPCFLAGS) -o imageunzip.o $<
48

Mike Hibler's avatar
all:  
Mike Hibler committed
49 50 51
imagedump: imagedump.o version.o
	$(CC) $(CFLAGS) imagedump.o version.o $(LIBS) -o imagedump

52 53 54
ntfs:
	@$(MAKE) -C ntfs all

Mike Hibler's avatar
all:  
Mike Hibler committed
55
version.c: imagezip.c imageunzip.c imagedump.c
56 57
	echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"

Leigh B. Stoller's avatar
Leigh B. Stoller committed
58
install: $(INSTALL_BINDIR)/imagezip $(INSTALL_BINDIR)/imageunzip
59

60
client-install: 
61 62 63
	$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/usr/local/bin
	$(INSTALL_PROGRAM) imagezip $(DESTDIR)/usr/local/bin/imagezip
	$(INSTALL_PROGRAM) imageunzip $(DESTDIR)/usr/local/bin/imageunzip
64

65
clean:
66 67 68
	@if [ -d ntfs ]; then \
		$(MAKE) -C ntfs clean; \
	fi;
69
	/bin/rm -f *.o imagezip imageunzip version.c
70 71

.PHONY:	$(NTFSDIR)