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-18 21:44:51 +00:00
|
|
|
trans_cache.c keyring.c vomp.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-03-14 22:54:31 +00:00
|
|
|
CFLAGS= @CFLAGS@
|
|
|
|
DEFS= @DEFS@
|
|
|
|
|
2012-04-20 07:27:36 +00:00
|
|
|
all: serval.c dna libservald.so
|
2012-03-14 22:54:31 +00:00
|
|
|
|
|
|
|
%.o: %.c $(HDRS)
|
|
|
|
$(CC) $(CFLAGS) $(DEFS) -Os -g -Wall -c $<
|
|
|
|
|
|
|
|
dna: $(OBJS)
|
2012-04-20 07:27:36 +00:00
|
|
|
$(CC) $(CFLAGS) -Os -g -Wall -o $@ $(OBJS) $(LDFLAGS)
|
|
|
|
|
|
|
|
libservald.so: $(OBJS)
|
|
|
|
$(CC) $(CFLAGS) -Os -g -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
|