Makefile.sa 2.29 KB
Newer Older
1 2
#
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
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
# 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 \
		  -I/usr/local/include/pthread/linuxthreads
PTHREADLIBS	= -L/usr/local/lib -llthread -llgcc_r

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

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

30 31
CFLAGS		= -O2 -g -Wall -fno-builtin-log -static \
		  $(PTHREADCFLAGS) -DSTATS
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 90 91 92 93
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).
#
# Best to leave this commented out.
#
#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: frisbee 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

.include <bsd.prog.mk>