1 # Copyright 2012 GRNET S.A. All rights reserved.
3 # Redistribution and use in source and binary forms, with or
4 # without modification, are permitted provided that the following
7 # 1. Redistributions of source code must retain the above
8 # copyright notice, this list of conditions and the following
11 # 2. Redistributions in binary form must reproduce the above
12 # copyright notice, this list of conditions and the following
13 # disclaimer in the documentation and/or other materials
14 # provided with the distribution.
16 # THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17 # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 # POSSIBILITY OF SUCH DAMAGE.
29 # The views and conclusions contained in the software and
30 # documentation are those of the authors and should not be
31 # interpreted as representing official policies, either expressed
32 # or implied, of GRNET S.A.
35 .PHONY: default all clean install install-src
37 include $(XSEG_HOME)/base.mk
38 #PEERS := xseg archip-sosd archip-mapperd archip-vlmcd archip-filed archip-bench
39 #PEERS := xseg archip-sosd archip-mapperd archip-vlmcd archip-filed archip-bench archip-dummy
40 PEERS := xseg archip-sosd archip-mapperd archip-vlmcd archip-filed archip-bench archip-dummy archip-benchfd
43 FILES+=$(shell ls *.h)
44 FILES+=$(shell ls *.c)
47 CPREQS=$(filter %.c,$^)
49 SUBDIR:=$(subst $(XSEG_HOME),,$(CURDIR))
54 #all: filed xseg sosd vlmcd mapperd
55 #all: filed xseg vlmcd mapperd
56 all: xseg archip-sosd archip-dummy archip-vlmcd mapperd archip-mapperd pfiled monitor vlmc-xseg archip-vlmcd archip-filed archip-bench
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
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
65 sosd: sosd.c $(BASE)/xseg/xseg.h $(BASE)/util_libs/user/sos/sos.h
66 $(CC) $(CFLAGS) -o $@ $< $(INC) -L$(LIB) -lxseg -lsos
68 monitor: monitor.c peer.c peer.h
69 $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg -lpthread -DMT
71 pfiled: pfiled.c common.c $(BASE)/xseg/xseg.h $(BASE)/xseg/protocol.h common.h
72 $(CC) $(CFLAGS) -o $@ $< common.c $(INC) -L$(LIB) -lxseg -lpthread
74 vlmc-xseg: vlmc-tool.c $(BASE)/xseg/xseg.h
75 $(CC) $(CFLAGS) -o $@ $< $(INC) -L$(LIB) -lxseg
77 xseg: xseg-tool.c $(BASE)/xtypes/xheap.c $(BASE)/xseg/xseg.h
78 $(CC) $(CFLAGS) -o $@ $< $(BASE)/xtypes/xheap.c $(INC) -L$(LIB) -lxseg
80 archip-sosd: mt-sosd.c hash.c hash.h peer.c peer.h
81 $(CC) $(CFLAGS) -o $@ $(CPREQS) $(INC) -L$(LIB) -lxseg -lrados -lpthread \
83 archip-dummy: dummy.c peer.c peer.h
84 $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg -lpthread -DMT
86 BENCH_PREQ=bench-xseg.c peer.c bench-lfsr.c bench-timer.c bench-utils.c \
87 bench-report.c bench-verify.c \
88 bench-xseg.h peer.h bench-lfsr.h $(BASE)/xseg/protocol.h
90 archip-bench: $(BENCH_PREQ)
91 $(CC) $(CFLAGS) -o $@ $(CPREQS) $(INC) -L$(LIB) -lxseg -lpthread -lm
93 archip-benchfd: $(BENCH_PREQ)
94 $(CC) $(CFLAGS) -o $@ $(CPREQS) $(INC) -L$(LIB) -lxseg -lpthread -lm -DFD
96 archip-filed: filed.c peer.c peer.h hash.c hash.h $(BASE)/xseg/protocol.h
97 $(CC) $(CFLAGS) -o $@ $(CPREQS) $(INC) -L$(LIB) -lxseg -lpthread -DMT \
100 archip-vlmcd: mt-vlmcd.c peer.c peer.h $(BASE)/xseg/protocol.h
101 $(CC) $(CFLAGS) -o $@ $< peer.c $(INC) -L$(LIB) -lxseg
103 MAPPER_PREQ=mapper.c mapper.h peer.c peer.h hash.h hash.c mapper-handling.c \
104 mapper-versions.h mapper-versions.c mapper-version0.h mapper-version0.c \
105 mapper-version1.h mapper-version1.c mapper-version2.h mapper-version2.c \
106 $(BASE)/xseg/protocol.h
108 archip-mapperd: $(MAPPER_PREQ)
109 $(CC) $(CFLAGS) -o $@ $(CPREQS) $(INC) -L$(LIB) -DST_THREADS \
113 install -d $(DESTDIR)$(bindir)
114 @for p in $(PEERS); do\
115 install -o 0 -g 0 -m 755 -t $(DESTDIR)$(bindir) $$p ; \
119 install -d $(DESTDIR)$(srcdir)$(SUBDIR)
120 @for f in $(FILES) ; do \
121 install -o 0 -g 0 -m 644 -t $(DESTDIR)$(srcdir)$(SUBDIR) $$f ; \
125 rm -f xseg sosd vlmcd mapperd archip-sosd monitor archip-mapperd \
126 pfiled vlmc-xseg archip-vlmcd archip-filed archip-bench \