diff --git a/CMakeLists.txt b/CMakeLists.txt index 374414573..b29a4a20b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -853,6 +853,9 @@ target_link_libraries (jt9code wsjt_fort wsjt_cxx) add_executable (wsprd lib/wsprd/wsprd.c lib/wsprd/wsprd_utils.c lib/wsprd/fano.c lib/wsprd/tab.c lib/wsprd/nhash.c) target_link_libraries (wsprd ${FFTW3_LIBRARIES}) +add_executable (wsprsim lib/wsprd/wsprsim.c lib/wsprd/wsprsim_utils.c lib/wsprd/wsprd_utils.c lib/wsprd/fano.c lib/wsprd/tab.c lib/wsprd/nhash.c) +target_link_libraries (wsprsim ) + add_executable (jt4code lib/jt4code.f90 wsjtx.rc) target_link_libraries (jt4code wsjt_fort wsjt_cxx) @@ -961,7 +964,7 @@ install (TARGETS wsjtx BUNDLE DESTINATION . COMPONENT runtime ) -install (TARGETS jt9 jt65code jt9code jt4code jt4sim wsprd message_aggregator +install (TARGETS jt9 jt65code jt9code jt4code jt4sim wsprd wsprsim message_aggregator RUNTIME DESTINATION ${WSJT_BIN_DESTINATION} COMPONENT runtime BUNDLE DESTINATION ${WSJT_BIN_DESTINATION} COMPONENT runtime ) diff --git a/lib/wsprd/Makefile b/lib/wsprd/Makefile index 8095bbcbe..724cbfb57 100644 --- a/lib/wsprd/Makefile +++ b/lib/wsprd/Makefile @@ -1,9 +1,9 @@ -#CC = gcc -CC = clang +CC = gcc +#CC = clang FC = gfortran FFLAGS = -O2 -Wall -Wno-conversion -CFLAGS= -I/usr/include -Wall -Wno-missing-braces -O2 +CFLAGS= -g -I/usr/include -Wall -Wno-missing-braces -O2 LDFLAGS = -L/usr/lib LIBS = -lfftw3 -lm @@ -19,21 +19,16 @@ LIBS = -lfftw3 -lm %.o: %.F90 ${FC} ${FFLAGS} -c $< -all: wsprd WSPRcode test_wspr +all: wsprd wsprsim -DEPS = fano.h -OBJS1 = wsprd.o wsprd_utils.o fano.o tab.o nhash.o +DEPS = wsprsim_utils.h wsprd_utils.h fano.h +OBJS1 = wsprd.o wsprd_utils.o tab.o fano.o nhash.o wsprd: $(OBJS1) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) -OBJS2 = test_wspr.o unpk.o wsprd_utils.o nhash.o -test_wspr: $(OBJS2) libwspr.a - $(FC) -o test_wspr $(FFLAGS) $(OBJS2) libwspr.a - - -OBJS3 = WSPRcode.o -WSPRcode: $(OBJS3) libwspr.a - $(FC) -o WSPRcode $(FFLAGS) $(OBJS3) libwspr.a +OBJS4 = wsprsim.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o +wsprsim: $(OBJS4) + $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) clean: - rm *.o wsprd + rm *.o wsprd wsprsim diff --git a/lib/wsprd/fano.h b/lib/wsprd/fano.h index 76001626b..7993499f1 100644 --- a/lib/wsprd/fano.h +++ b/lib/wsprd/fano.h @@ -9,6 +9,9 @@ Minor modifications by Joe Taylor, K1JT */ +#ifndef FANO_H +#define FANO_H + int fano(unsigned int *metric, unsigned int *cycles, unsigned int *maxnp, unsigned char *data,unsigned char *symbols, unsigned int nbits, int mettab[2][256],int delta,unsigned int maxcycles); @@ -17,5 +20,4 @@ int encode(unsigned char *symbols,unsigned char *data,unsigned int nbytes); extern unsigned char Partab[]; - - +#endif diff --git a/lib/wsprd/wsprd.c b/lib/wsprd/wsprd.c index 4bd019478..40605a72c 100644 --- a/lib/wsprd/wsprd.c +++ b/lib/wsprd/wsprd.c @@ -37,6 +37,7 @@ #include #include "fano.h" +#include "nhash.h" #include "wsprd_utils.h" #define max(x,y) ((x) > (y) ? (x) : (y)) diff --git a/lib/wsprd/wsprd_utils.c b/lib/wsprd/wsprd_utils.c index 3bf965817..806ad190b 100644 --- a/lib/wsprd/wsprd_utils.c +++ b/lib/wsprd/wsprd_utils.c @@ -27,7 +27,6 @@ along with this program. If not, see . */ #include "wsprd_utils.h" -#include "nhash.h" #ifndef int32_t #define int32_t int diff --git a/lib/wsprd/wsprd_utils.h b/lib/wsprd/wsprd_utils.h index aef057093..6384999b8 100644 --- a/lib/wsprd/wsprd_utils.h +++ b/lib/wsprd/wsprd_utils.h @@ -1,3 +1,6 @@ +#ifndef WSPRD_UTILS_H +#define WSPRD_UTILS_H + #include #include #include @@ -5,6 +8,7 @@ #include #include #include +#include "nhash.h" void unpack50( signed char *dat, int32_t *n1, int32_t *n2 ); @@ -20,3 +24,5 @@ void deinterleave(unsigned char *sym); int floatcomp(const void* elem1, const void* elem2); int unpk_( signed char *message, char hashtab[32768][13], char *call_loc_pow, char *callsign); + +#endif