blob: 1a0e42f2b92cc7aba9226809495a8ed8a282922d (
plain)
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
90
|
PERHAPS64 := $(shell uname -m | perl -ne "print /64/ ? '64' : '';")
LIB = /lib$(PERHAPS64)
ifeq ($(PERHAPS64), "64")
FPIC=
else
FPIC=-fPIC
endif
ifndef PREFIX
PREFIX=/opt/rosx
endif
PCREINC = `pcre-config --cflags`
PCRELIB = `pcre-config --libs`
CASESENSITIVE = "yes"
ifeq ($(CASESENSITIVE), "no")
PCRE_OPT=PCRE_CASELESS
REGCOMP_OPT=REG_ICASE
else
PCRE_OPT=0
REGCOMP_OPT=REG_EXTENDED
endif
REGEXP= -DUSE_PCRE_REGEX -DPCRE_OPT=$(PCRE_OPT)
OBJ = ivyloop.o timer.o ivysocket.o ivy.o ivybuffer.o ivyfifo.o ivybind.o intervalRegexp.o
CC=gcc
LIBTOOL=ar q # linux and solaris
CFLAGS = -g -Wall $(FPIC)
TOOLS_DIR = ../tools
# ------------------------------------------------------------------------------------------
.c.o:
$(CC) $(CFLAGS) -c $*.c
.cpp.o:
$(CPP) $(CFLAGS) -c $*.cpp
all: static-libs shared-libs tools
static-libs: libivy.a
shared-libs: libivy.dylib
ivybind.o: ivybind.c
$(CC) -c $(CFLAGS) $(REGEXP) $(PCREINC) ivybind.c
libivy.a: $(OBJ)
rm -f $@
$(LIBTOOL) $@ $(OBJ)
libivy.dylib: $(OBJ)
$(CC) -dynamiclib -o $@ $(OBJ) $(PCRELIB)
# ------------------------------------------------------------------------------------------
installlibs: static-libs shared-libs
test -d $(DESTDIR)$(PREFIX)$(LIB) || mkdir -p $(DESTDIR)$(PREFIX)$(LIB)
install -m644 libivy.a $(DESTDIR)$(PREFIX)$(LIB)
install -m644 libivy.dylib $(DESTDIR)$(PREFIX)$(LIB)
@(cd $(TOOLS_DIR) && $(MAKE) -f Makefile.osx install)
includes:
test -d $(DESTDIR)$(PREFIX)/include/Ivy || mkdir -p $(DESTDIR)$(PREFIX)/include/Ivy
install -m644 ivy.h $(DESTDIR)$(PREFIX)/include/Ivy/
install -m644 ivybind.h $(DESTDIR)$(PREFIX)/include/Ivy/
install -m644 ivybuffer.h $(DESTDIR)$(PREFIX)/include/Ivy/
install -m644 ivychannel.h $(DESTDIR)$(PREFIX)/include/Ivy/
install -m644 ivydebug.h $(DESTDIR)$(PREFIX)/include/Ivy/
install -m644 ivyloop.h $(DESTDIR)$(PREFIX)/include/Ivy/
install -m644 ivysocket.h $(DESTDIR)$(PREFIX)/include/Ivy/
install -m644 list.h $(DESTDIR)$(PREFIX)/include/Ivy/
install -m644 timer.h $(DESTDIR)$(PREFIX)/include/Ivy/
install -m644 version.h $(DESTDIR)$(PREFIX)/include/Ivy/
installbins: commands
test -d $(DESTDIR)$(PREFIX)/bin || mkdir -p $(DESTDIR)$(PREFIX)/bin
install -m755 ivyprobe $(DESTDIR)$(PREFIX)/bin
install -m755 ivyperf $(DESTDIR)$(PREFIX)/bin
tools: static-libs
@(cd $(TOOLS_DIR) && $(MAKE) -f Makefile.osx)
install: installlibs installbins includes
# ------------------------------------------------------------------------------------------
clean:
-rm -f *.o *.a *.dylib *.dylib.* *~
@(cd $(TOOLS_DIR) && $(MAKE) -f Makefile.osx clean)
|