Makefile-linux.sa 2.22 KB
Newer Older
Mike Hibler's avatar
Mike Hibler committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#

# 
# Makefile for the standalone version of frisbee.
# (Standalone meaning not part of the Netbed build environment.)
#
SBINDIR=/usr/local/sbin
BINDIR=	/usr/local/bin

IMAGEZIPDIR	= ../imagezip

SHAREDOBJS	= log.o network.o trace.o utils.o

PTHREADCFLAGS	= -D_THREAD_SAFE -pthread

# get 64-bit off_t and pread/pwrite protos
LINUXOPTS	= -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE

CLIENTFLAGS	= $(CFLAGS)
CLIENTLIBS	= -lz $(PTHREADLIBS)
CLIENTOBJS	= client.o frisbee.o $(SHAREDOBJS)

SERVERFLAGS	= $(CFLAGS)
SERVERLIBS	= $(PTHREADLIBS)
SERVEROBJS	= server.o $(SHAREDOBJS)

CFLAGS		= -O2 -g -Wall -static $(PTHREADCFLAGS) $(LINUXOPTS) -DSTATS
LDFLAGS		= -static

#
# Define this if your implementation of cond_vars works well
# ("works well" in this case means doesn't hang forever or burn up
# the CPU while in condwait).
#
CFLAGS		+= -DCONDVARS_WORK

#
# Define this to a non-zero value to enable recording of trace data
#
#CFLAGS		+= -DNEVENTS=25000

#
# Turn on client event handling
#
# Leave these commented out!
#
#CFLAGS		+= -DDOEVENTS
#CLIENTOBJS	+= event.o $(OBJDIR)/event/lib/event.o $(OBJDIR)/event/lib/util.o
#CLIENTLIBS	+= `elvin-config --libs vin4c`
#EVENTFLAGS	= $(CFLAGS) `elvin-config --cflags vin4c` -I$(TESTBED_SRCDIR)

all: frisbeed

frisbee: $(CLIENTOBJS)
	$(CC) $(LDFLAGS) $(CLIENTFLAGS) $(CLIENTOBJS) $(CLIENTLIBS) -o frisbee
	cp frisbee frisbee.debug
	strip frisbee

frisbeed: $(SERVEROBJS)
	$(CC) $(LDFLAGS) $(SERVERFLAGS) $(SERVEROBJS) $(SERVERLIBS) -o frisbeed
	cp frisbeed frisbeed.debug
	strip frisbeed


event.o:	$(SRCDIR)/event.c decls.h log.h event.h
	$(CC) $(EVENTFLAGS) -c event.c

$(IMAGEZIPDIR)/imageunzip.c: $(IMAGEZIPDIR)/imagehdr.h $(IMAGEZIPDIR)/queue.h

frisbee.o:	$(IMAGEZIPDIR)/imageunzip.c
	$(CC) -c $(CFLAGS) -DFRISBEE -I$(IMAGEZIPDIR) -o frisbee.o \
		$(IMAGEZIPDIR)/imageunzip.c

client.o:	decls.h log.h utils.h trace.h
server.o:	decls.h log.h utils.h trace.h
log.o:		decls.h log.h
network.o:	decls.h utils.h
trace.o:	decls.h trace.h log.h

install:
	$(INSTALL) frisbee $(DESTDIR)$(BINDIR)/frisbee
	$(INSTALL) frisbeed $(DESTDIR)$(SBINDIR)/frisbeed

clean:
	rm -f *.o *.a frisbee frisbeed frisbee.debug frisbeed.debug