2012-03-14 22:54:31 +00:00
|
|
|
SRCS= dna.c server.c client.c peers.c ciphers.c responses.c packetformats.c dataformats.c \
|
2012-04-12 23:59:43 +00:00
|
|
|
srandomdev.c simulate.c batman.c gateway.c \
|
2012-03-14 22:54:31 +00:00
|
|
|
overlay.c overlay_buffer.c overlay_interface.c overlay_payload.c overlay_route.c \
|
2012-03-16 22:30:51 +00:00
|
|
|
overlay_packetformats.c overlay_abbreviations.c overlay_advertise.c overlay_mdp.c \
|
2012-03-14 22:54:31 +00:00
|
|
|
rhizome.c rhizome_http.c rhizome_bundle.c rhizome_database.c rhizome_crypto.c \
|
|
|
|
rhizome_packetformats.c rhizome_fetch.c sqlite3.c encode.c sha2.c randombytes.c \
|
2012-03-16 22:30:51 +00:00
|
|
|
overlay_broadcast.c dna_identity.c commandline.c serval_packetvisualise.c \
|
2012-04-22 22:54:39 +00:00
|
|
|
trans_cache.c keyring.c vomp.c pa_phone.c
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-04-19 06:18:00 +00:00
|
|
|
OBJS= $(SRCS:.c=.o)
|
2012-03-14 22:54:31 +00:00
|
|
|
|
|
|
|
HDRS= Makefile serval.h sqlite-amalgamation-3070900/sqlite3.h sha2.h rhizome.h
|
|
|
|
|
2012-04-20 07:27:36 +00:00
|
|
|
LDFLAGS=@LDFLAGS@
|
2012-04-23 05:58:00 +00:00
|
|
|
CFLAGS= @CPPFLAGS@ @CFLAGS@
|
2012-03-14 22:54:31 +00:00
|
|
|
DEFS= @DEFS@
|
|
|
|
|
2012-04-20 07:27:36 +00:00
|
|
|
all: serval.c dna libservald.so
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-04-20 07:40:38 +00:00
|
|
|
sqlite3.o: sqlite3.c
|
|
|
|
$(CC) $(CFLAGS) $(DEFS) -Wall -c $<
|
|
|
|
|
2012-03-14 22:54:31 +00:00
|
|
|
%.o: %.c $(HDRS)
|
2012-04-20 07:40:38 +00:00
|
|
|
$(CC) $(CFLAGS) $(DEFS) -Wall -c $<
|
2012-03-14 22:54:31 +00:00
|
|
|
|
|
|
|
dna: $(OBJS)
|
2012-04-20 07:40:38 +00:00
|
|
|
$(CC) $(CFLAGS) -Wall -o $@ $(OBJS) $(LDFLAGS)
|
2012-04-20 07:27:36 +00:00
|
|
|
|
|
|
|
libservald.so: $(OBJS)
|
2012-04-20 07:40:38 +00:00
|
|
|
$(CC) $(CFLAGS) -Wall -shared -o $@ $(OBJS) $(LDFLAGS)
|
2012-03-14 22:54:31 +00:00
|
|
|
|
|
|
|
serval.c: $(SRCS) $(HDRS)
|
|
|
|
cat serval.h > serval.c
|
|
|
|
echo '#include <sys/mman.h>' >>serval.c
|
|
|
|
cat $(SRCS) | grep -v "#include" | sed -e 's/inet_ntoa/ast_inet_ntoa/g' >>serval.c
|
|
|
|
|
|
|
|
testserver: dna
|
|
|
|
clear
|
|
|
|
rm hlr.dat
|
|
|
|
./dna -vvv -S 1 -f hlr.dat
|
|
|
|
|
|
|
|
testcreate: dna
|
|
|
|
clear
|
|
|
|
./dna -vvv -d 0427679796 -C
|
|
|
|
@touch testcreate
|
|
|
|
|
|
|
|
testget: dna testcreate
|
|
|
|
clear
|
|
|
|
./dna -vvv -d 0427679796 -R dids | tee testget
|
|
|
|
|
|
|
|
testset: dna testget
|
|
|
|
clear
|
|
|
|
# Try writing a value to a variable
|
|
|
|
echo "short value" >shortvalue.txt
|
|
|
|
./dna -vvv -s `cat testget | cut -f2 -d: | tail -1` -i 0 -W note=@shortvalue.txt
|
|
|
|
|
|
|
|
testbigset: testget
|
|
|
|
clear
|
|
|
|
./dna -vvv -s `cat testget | cut -f2 -d: | tail -1` -i 0 -W note=@411.txt
|