GNUmakefile.in 1.76 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 10 11 12 13
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ../..
SUBDIR		= event/lib

include $(OBJDIR)/Makeconf

14
SYSTEM	       := $(shell uname -s)
15
PROGRAMS	= libevent.a
16
ifneq ($(SYSTEM),Linux)
17
PROGRAMS       += libevent_r.a event.so
18 19 20
endif

all:		$(PROGRAMS)
21 22 23

include $(TESTBED_SRCDIR)/GNUmakerules

24
#CFLAGS += -DDEBUG
25 26 27
CFLAGS += -O2 -g -static -I. -Wall -I$(TESTBED_SRCDIR)/lib/libtb
SCFLAGS = $(CFLAGS) `elvin-config --cflags vin4c`
TCFLAGS = $(CFLAGS) `elvin-config --cflags vin4mt`
28
# Special CFLAGS w/o warnings, for SWIG-generated code
29
CFLAGS_NOWARN += -O2 -g -static -I. -I$(TESTBED_SRCDIR)/lib/libtb
30
CFLAGS_NOWARN += `elvin-config --cflags vin4mt`
31

32 33
LDFLAGS += -L${OBJDIR}/lib/libtb

34
OBJS	= event.o util.o
35
POBJS	= event_r.o util.o
36 37 38 39 40

libevent.a:	$(OBJS)
	$(AR) crv $@ $(OBJS)
	$(RANLIB) $@

41 42 43 44
libevent_r.a:	$(POBJS)
	$(AR) crv $@ $(POBJS)
	$(RANLIB) $@

45
$(OBJS):	event.h
46 47 48
$(POBJS):	event.h

event_r.o:	event.c
49 50 51 52 53 54
	$(CC) $(TCFLAGS) -DTHREADED -c -o event_r.o $<

event.o:	event.c
	$(CC) $(SCFLAGS) -c -o event.o $<
util.o:		util.c
	$(CC) $(SCFLAGS) -c -o util.o $<
55

56 57 58
#
# These three targets are for the perl binding to the event system
# 
59 60 61
#$(SRCDIR)/event_wrap.c:	event.i	event.c event.pm.tail
#	swig -exportall -dnone -perl5 -shadow -I$(SRCDIR) $(SRCDIR)/event.i
#	cat $(SRCDIR)/event.pm.tail >> event.pm
62 63

event_wrap.o:	$(SRCDIR)/event_wrap.c
64
	$(CC) -c $(CFLAGS_NOWARN) -I/usr/libdata/perl/5.00503/mach/CORE $<
65 66 67

event.so:	event.o event_wrap.o util.o
	ld -shared $^ $(OBJDIR)/lib/libtb/libtb.a \
68
		`elvin-config --libs vin4c` -lcrypto -o event.so
Leigh B. Stoller's avatar
Leigh B. Stoller committed
69

70 71 72 73
LIB_STUFF       = event.pm event.so

install: $(addprefix $(INSTALL_LIBDIR)/, $(LIB_STUFF))

Leigh B. Stoller's avatar
Leigh B. Stoller committed
74

75
clean:
76
	/bin/rm -f *.o libevent.a libevent_r.a *.so *.pm