~mir-team/mir/trunk-0.1.7

« back to all changes in this revision

Viewing changes to 3rd_party/libancillary/Makefile

  • Committer: Alan Griffiths
  • Date: 2012-09-03 11:49:23 UTC
  • mto: This revision was merged to the branch mainline in revision 114.
  • Revision ID: alan@octopull.co.uk-20120903114923-na70zt8h5s6gnnkj
Add 3rd party including libancillary

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
###########################################################################
 
2
# libancillary - black magic on Unix domain sockets
 
3
# (C) Nicolas George
 
4
# Makefile - guess what
 
5
###########################################################################
 
6
 
 
7
# Redistribution and use in source and binary forms, with or without
 
8
# modification, are permitted provided that the following conditions are met:
 
9
 
10
#  1. Redistributions of source code must retain the above copyright notice,
 
11
#     this list of conditions and the following disclaimer.
 
12
#  2. Redistributions in binary form must reproduce the above copyright
 
13
#     notice, this list of conditions and the following disclaimer in the
 
14
#     documentation and/or other materials provided with the distribution.
 
15
#  3. The name of the author may not be used to endorse or promote products
 
16
#     derived from this software without specific prior written permission.
 
17
 
18
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 
19
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 
20
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 
21
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
22
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
23
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 
24
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 
25
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 
26
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 
27
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
28
 
 
29
CC=gcc
 
30
CFLAGS=-Wall -g -O2
 
31
LDFLAGS=
 
32
LIBS=
 
33
AR=ar
 
34
RANLIB=ranlib
 
35
RM=rm
 
36
CP=cp
 
37
MKDIR=mkdir
 
38
TAR=tar
 
39
GZIP=gzip -9
 
40
 
 
41
NAME=libancillary
 
42
DISTRIBUTION=API COPYING Makefile ancillary.h fd_send.c fd_recv.c test.c
 
43
VERSION=0.9.1
 
44
 
 
45
OBJECTS=fd_send.o fd_recv.o
 
46
 
 
47
TUNE_OPTS=-DNDEBUG
 
48
#TUNE_OPTS=-DNDEBUG \
 
49
        -DSPARE_SEND_FDS -DSPARE_SEND_FD -DSPARE_RECV_FDS -DSPARE_RECV_FD
 
50
 
 
51
.c.o:
 
52
        $(CC) -c $(CFLAGS) $(TUNE_OPTS) $<
 
53
 
 
54
all: libancillary.a
 
55
 
 
56
libancillary.a: $(OBJECTS)
 
57
        $(AR) cr $@ $(OBJECTS)
 
58
        $(RANLIB) $@
 
59
 
 
60
fd_send.o: ancillary.h
 
61
fd_recv.o: ancillary.h
 
62
 
 
63
test: test.c libancillary.a
 
64
        $(CC) -o $@ $(CFLAGS) $(LDFLAGS) -L. test.c -lancillary $(LIBS)
 
65
 
 
66
clean:
 
67
        -$(RM) -f *.o *.a test 
 
68
 
 
69
dist:
 
70
        $(MKDIR) $(NAME)-$(VERSION)
 
71
        $(CP) $(DISTRIBUTION) $(NAME)-$(VERSION)
 
72
        $(TAR) -cf - $(NAME)-$(VERSION) | $(GZIP) > $(NAME)-$(VERSION).tar.gz
 
73
        $(RM) -rf $(NAME)-$(VERSION)