Commit f00d574e authored by Leigh Stoller's avatar Leigh Stoller

Add testbed style GNUmakefile.in files and add subdirs to configure.

Also several changes for building on FreeBSD. I've left the older
Makefiles in place so Ian can continue to build in his environmant
(Linux?).
parent 1046c4f5
......@@ -9,6 +9,7 @@ export CXX = @CXX@
export LD = @CC@ ${CFLAGS}
export STRIP = @STRIP@
export RANLIB = @RANLIB@
export AR = @AR@
prefix = @prefix@
exec_prefix = @exec_prefix@
......
......@@ -1161,6 +1161,8 @@ outfiles="$outfiles Makeconf GNUmakefile \
vis/GNUmakefile vis/vistopology vis/webvistopology vis/top2gif \
rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
rc.d/cvsupd.sh \
event/GNUmakefile event/lib/GNUmakefile event/sched/GNUmakefile \
event/test/GNUmakefile \
apache/GNUmakefile apache/apache.conf "
#
......
......@@ -246,6 +246,8 @@ outfiles="$outfiles Makeconf GNUmakefile \
vis/GNUmakefile vis/vistopology vis/webvistopology vis/top2gif \
rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
rc.d/cvsupd.sh \
event/GNUmakefile event/lib/GNUmakefile event/sched/GNUmakefile \
event/test/GNUmakefile \
apache/GNUmakefile apache/apache.conf "
#
......
#
# Insert Copyright Here.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ..
SUBDIR = event
include $(OBJDIR)/Makeconf
SUBDIRS = lib sched test
all: $(SUBDIRS)
include $(TESTBED_SRCDIR)/GNUmakerules
lib:
@$(MAKE) -C lib all
sched:
@$(MAKE) -C sched all
test:
@$(MAKE) -C test all
install:
@$(MAKE) -C lib install
@$(MAKE) -C sched install
@$(MAKE) -C test install
clean: subdir-clean
subdir-clean:
@$(MAKE) -C lib clean
@$(MAKE) -C sched clean
@$(MAKE) -C test clean
distclean: subdir-distclean
subdir-distclean:
@$(MAKE) -C lib clean
@$(MAKE) -C sched clean
@$(MAKE) -C test clean
.PHONY: $(SUBDIRS)
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../..
SUBDIR = event/lib
include $(OBJDIR)/Makeconf
all: libevent.a
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -O -g -static -I. -Wall -DDEBUG
CFLAGS += `elvin-config --cflags vin4mt`
OBJS = event.o util.o
libevent.a: $(OBJS)
$(AR) crv $@ $(OBJS)
$(RANLIB) $@
$(OBJS): event.h
clean:
/bin/rm -f *.o libevent.a
......@@ -7,14 +7,14 @@
* @COPYRIGHT@
*/
static char rcsid[] = "$Id: event.c,v 1.10 2002-02-19 16:18:21 imurdock Exp $";
static char rcsid[] = "$Id: event.c,v 1.11 2002-02-19 17:12:52 stoller Exp $";
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <event.h>
#include "event.h"
static char hostname[MAXHOSTNAMELEN];
......
......@@ -6,11 +6,9 @@
* @COPYRIGHT@
*/
static char rcsid[] = "$Id: util.c,v 1.1 2001-11-02 04:43:04 imurdock Exp $";
#include <stdio.h>
#include <stdlib.h>
#include <event.h>
#include "event.h"
/* Attempt to allocate SIZE bytes of memory and exit if memory
allocation fails. Returns pointer to allocated memory. */
......
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../..
SUBDIR = event/sched
include $(OBJDIR)/Makeconf
all: event-sched
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -O -g -static -I. -I$(SRCDIR)/../lib -Wall -pthread -DDEBUG
CFLAGS += `elvin-config --cflags vin4mt`
LDFLAGS += -pthread -L../lib
LIBS += -levent -lcipher
LIBS += `elvin-config --libs vin4mt`
OBJS = event-sched.o queue.o
event-sched: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(OBJS): event-sched.h
clean:
/bin/rm -f *.o event-sched
......@@ -11,15 +11,12 @@
* @COPYRIGHT@
*/
static char rcsid[] = "$Id: event-sched.c,v 1.3 2002-02-19 15:47:46 imurdock Exp $";
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include <event-sched.h>
#include "event-sched.h"
static void enqueue(event_handle_t handle, event_notification_t notification,
char *host, event_type_t type, void *data);
......
......@@ -6,7 +6,7 @@
*
* @COPYRIGHT@
*
* $Id: event-sched.h,v 1.2 2002-01-29 17:08:14 imurdock Exp $
* $Id: event-sched.h,v 1.3 2002-02-19 17:12:52 stoller Exp $
*/
#ifndef __SCHED_H__
......@@ -14,7 +14,7 @@
#include <stdio.h>
#include <sys/time.h>
#include <event.h>
#include "event.h"
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
......
......@@ -6,16 +6,13 @@
* @COPYRIGHT@
*/
static char rcsid[] = "$Id: queue.c,v 1.3 2002-01-29 17:08:14 imurdock Exp $";
#include <stdio.h>
#include <assert.h>
#include <pthread.h>
#include <semaphore.h>
#include <stdlib.h>
#include <sys/time.h>
#include <event-sched.h>
#include "event-sched.h"
/* The size of the event queue (i.e., the number of events that can be
pending at any given time). */
......
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../..
SUBDIR = event/test
include $(OBJDIR)/Makeconf
TESTS = test-consume \
test-produce \
test-attr-consume \
test-attr-produce \
test-queue \
test-sched-produce
all: $(TESTS)
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -O -g -static -I. -I$(SRCDIR)/../lib -Wall -pthread -DDEBUG
CFLAGS += `elvin-config --cflags vin4mt`
LDFLAGS += -pthread -L../lib
LIBS += -levent -lcipher -lc_r
#
# XXX elvin-config adds -lc which is rather bogus, and messes up -pthread
# build on freebsd. I made a vain attempt to filter it out, but
# gave up quickly. Deal with it later.
#
#LIBS += `elvin-config --libs vin4mt`
LIBS += -L/usr/local/lib -lvin4mt -lvin4c -lvin4 -lssl -lcrypto -lm
%: %.c
$(CC) $(LDFLAGS) -o $@ $(CFLAGS) $< $(LIBS)
$(TESTS): ../lib/libevent.a ../lib/event.h
clean:
/bin/rm -f *.o event-sched
/* test-attr-consume.c: Test delivery of events, with attributes (consumer). */
static char rcsid[] = "$Id: test-attr-consume.c,v 1.5 2002-02-19 15:51:01 imurdock Exp $";
#include <event.h>
#include "event.h"
static void callback(event_handle_t handle, event_notification_t notification,
char *host, event_type_t type, void *data);
......
/* test-attr-produce.c: Test delivery of events, with attributes (producer). */
static char rcsid[] = "$Id: test-attr-produce.c,v 1.5 2002-02-19 15:51:01 imurdock Exp $";
#include <event.h>
#include "event.h"
int
main(int argc, char **argv)
......
/* test-consume.c: Test delivery of events (consumer). */
static char rcsid[] = "$Id: test-consume.c,v 1.4 2002-02-19 15:51:01 imurdock Exp $";
#include <event.h>
#include "event.h"
static void callback(event_handle_t handle, event_notification_t notification,
char *host, event_type_t type, void *data);
......
/* test-produce.c: Test delivery of events (producer). */
static char rcsid[] = "$Id: test-produce.c,v 1.3 2002-02-19 15:51:01 imurdock Exp $";
#include <event.h>
#include "event.h"
int
main(int argc, char **argv)
......
/* test-sched-produce.c: Test event scheduler, with attributes (producer).
This test may be used with test-consume or test-attr-consume. */
static char rcsid[] = "$Id: test-sched-produce.c,v 1.2 2002-02-19 15:51:01 imurdock Exp $";
#include <event.h>
#include "event.h"
int
main(int argc, char **argv)
......
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