diff options
author | fcolin | 2007-02-15 16:58:52 +0000 |
---|---|---|
committer | fcolin | 2007-02-15 16:58:52 +0000 |
commit | 0751f63e93120b1eb895897eda9052a7842586be (patch) | |
tree | 8c1f262e7f25180b5084695b6fe9b46ff1402e81 /src/Makefile.osx | |
parent | 018219f2fc25f76e83f4111455d7a6c678223482 (diff) | |
download | ivy-c-0751f63e93120b1eb895897eda9052a7842586be.zip ivy-c-0751f63e93120b1eb895897eda9052a7842586be.tar.gz ivy-c-0751f63e93120b1eb895897eda9052a7842586be.tar.bz2 ivy-c-0751f63e93120b1eb895897eda9052a7842586be.tar.xz |
Copié à la demande de Glejeune pour la construction de ivy-c sur Mac OS X
Diffstat (limited to 'src/Makefile.osx')
-rw-r--r-- | src/Makefile.osx | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/Makefile.osx b/src/Makefile.osx new file mode 100644 index 0000000..71e1520 --- /dev/null +++ b/src/Makefile.osx @@ -0,0 +1,91 @@ +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 ivybind.o intervalRegexp.o +CC=gcc +LIBTOOL=ar q # linux and solaris +CFLAGS = -g -Wall $(FPIC) + +TARGETS = ivyprobe ivyperf + +# ------------------------------------------------------------------------------------------ + +.c.o: + $(CC) $(CFLAGS) -c $*.c + +all: static-libs commands shared-libs + +static-libs: libivy.a + +shared-libs: libivy.dylib + +commands: $(TARGETS) + +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) + +ivyprobe: ivyprobe.o libivy.a + $(CC) $(CFLAGS) -o $@ ivyprobe.o -L. -livy $(PCRELIB) $(EXTRALIB) + +ivyperf: ivyperf.o libivy.a + $(CC) $(CFLAGS) -o $@ ivyperf.o -L. -livy $(PCRELIB) $(EXTRALIB) + +# ------------------------------------------------------------------------------------------ + +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) + +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 + +install: installlibs installbins includes + +# ------------------------------------------------------------------------------------------ + +clean: + -rm -f $(TARGETS) *.o *.a *.dylib *.dylib.* *~
\ No newline at end of file |