Rename archipelago peers with archip- prefix
[archipelago] / xseg / peers / user / Makefile
1 # Copyright 2012 GRNET S.A. All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or
4 # without modification, are permitted provided that the following
5 # conditions are met:
6 #
7 #   1. Redistributions of source code must retain the above
8 #      copyright notice, this list of conditions and the following
9 #      disclaimer.
10 #   2. Redistributions in binary form must reproduce the above
11 #      copyright notice, this list of conditions and the following
12 #      disclaimer in the documentation and/or other materials
13 #      provided with the distribution.
14 #
15 # THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
16 # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
19 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22 # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 # POSSIBILITY OF SUCH DAMAGE.
27 #
28 # The views and conclusions contained in the software and
29 # documentation are those of the authors and should not be
30 # interpreted as representing official policies, either expressed
31 # or implied, of GRNET S.A.
32 #
33
34 .PHONY: default all clean install install-src
35
36 include $(XSEG_HOME)/base.mk
37 PEERS := xseg archip-sosd archip-mapperd archip-vlmcd archip-pfiled archip-bench
38
39 FILES="Makefile"
40 FILES+=$(shell ls *.h)
41 FILES+=$(shell ls *.c)
42 FILES+=""
43
44 CPREQS=$(filter %.c,$^)
45
46 SUBDIR:=$(subst $(XSEG_HOME),,$(CURDIR))
47
48
49 default: $(PEERS)
50
51 #all: filed xseg sosd vlmcd mapperd
52 #all: filed xseg vlmcd mapperd
53 all: filed xseg archip-sosd dummy archip-vlmcd mapperd archip-mapperd pfiled monitor vlmc-xseg archip-vlmcd archip-pfiled archip-bench
54
55
56 filed: filed.c $(BASE)/xseg/xseg.h
57         $(CC) $(CFLAGS) -o $@ $< $(INC) -L$(LIB) -lxseg -lpthread
58
59 vlmcd: vlmcd.c common.c $(BASE)/xseg/xseg.h $(BASE)/xseg/protocol.h common.h
60         $(CC) $(CFLAGS) -o $@ $< common.c $(INC) -L$(LIB) -lxseg
61
62 mapperd: mapperd.c common.c $(BASE)/xseg/xseg.h $(BASE)/xseg/protocol.h common.h
63         $(CC) $(CFLAGS) -o $@ $< common.c $(INC) -L$(LIB) -lxseg
64
65 sosd: sosd.c $(BASE)/xseg/xseg.h $(BASE)/util_libs/user/sos/sos.h
66         $(CC) $(CFLAGS) -o $@ $< $(INC) -L$(LIB) -lxseg -lsos
67
68 xseg: xseg-tool.c $(BASE)/xtypes/xheap.c $(BASE)/xseg/xseg.h
69         $(CC) $(CFLAGS) -o $@ $< $(BASE)/xtypes/xheap.c $(INC) -L$(LIB) -lxseg
70
71 archip-sosd: mt-sosd.c peer.c peer.h
72         $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg -lrados -lpthread \
73                                                         -lcrypto -DMT
74 dummy: dummy.c peer.c peer.h
75         $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg -lpthread -DMT
76
77 archip-bench: bench-xseg.c peer.c bench-timer.c bench-lfsr.c bench-utils.c bench-xseg.h peer.h bench-lfsr.h
78         $(CC) $(CFLAGS) -o $@ $(CPREQS) $(INC) -L$(LIB) -lxseg -lpthread -lm
79
80 monitor: monitor.c peer.c peer.h
81         $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg -lpthread -DMT
82
83 mt-vlmcd: mt-vlmcd.c peer.c peer.h $(BASE)/xseg/protocol.h
84         $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg -lpthread -DMT
85
86 archip-pfiled: mt-pfiled.c peer.c peer.h $(BASE)/xseg/protocol.h
87         $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg -lpthread -DMT
88
89 archip-vlmcd: mt-vlmcd.c peer.c peer.h $(BASE)/xseg/protocol.h
90         $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg
91
92 archip-mapperd: mt-mapperd.c peer.c peer.h $(BASE)/xseg/protocol.h
93         $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -DST_THREADS -lxseg -lst -lcrypto
94
95 pfiled: pfiled.c common.c $(BASE)/xseg/xseg.h $(BASE)/xseg/protocol.h common.h
96         $(CC) $(CFLAGS) -o $@ $< common.c  $(INC) -L$(LIB) -lxseg -lpthread
97
98 vlmc-xseg: vlmc-tool.c $(BASE)/xseg/xseg.h
99         $(CC) $(CFLAGS) -o $@ $< $(INC) -L$(LIB) -lxseg
100
101 install:
102         install -d $(DESTDIR)$(bindir)
103         @for p in $(PEERS); do\
104                 install -o 0 -g 0 -m 755 -t $(DESTDIR)$(bindir) $$p ; \
105         done
106
107 install-src:
108         install -d $(DESTDIR)$(srcdir)$(SUBDIR)
109         @for f in $(FILES) ; do \
110                 install -o 0 -g 0 -m 644 -t $(DESTDIR)$(srcdir)$(SUBDIR) $$f ; \
111         done
112
113 clean:
114         rm -f filed xseg sosd vlmcd mapperd archip-sosd monitor archip-mapperd \
115                 pfiled vlmc-xseg archip-vlmcd mt-vlmcd archip-pfiled archip-bench