]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
build system modifications
authorRamakrishnan Muthukrishnan <ram@leastauthority.com>
Fri, 17 Feb 2023 09:39:58 +0000 (15:09 +0530)
committerRamakrishnan Muthukrishnan <ram@leastauthority.com>
Fri, 17 Feb 2023 09:39:58 +0000 (15:09 +0530)
Makefile
main.c

index bcf706effa80f0b0a486680e0580fd7221ba4c35..1a1b2238dbb2a8c851ecdddbcee0d16f0e98f5e5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -233,8 +233,11 @@ ifeq ($(UNAME_S), Darwin)
 SYSLIBS=-framework IOKit
 endif
 
+RUST_LIB=-Lrust/target/debug -lhpsdr
+
 LIBS=  $(LDFLAGS) $(AUDIO_LIBS) $(USBOZY_LIBS) $(GTKLIBS) $(GPIO_LIBS) $(SOAPYSDRLIBS) $(STEMLAB_LIBS) \
-       $(MIDI_LIBS) -lwdsp -lpthread -lm $(SYSLIBS)
+       $(MIDI_LIBS) $(RUST_LIB) -lwdsp -lpthread -lm $(SYSLIBS)
+
 INCLUDES=$(GTKINCLUDES)
 
 COMPILE=$(CC) $(CFLAGS) $(OPTIONS) $(INCLUDES)
@@ -320,7 +323,8 @@ switch_menu.c \
 toolbar_menu.c \
 sintab.c
 
-
+RUST_SRC=\
+rust/lib.rs
 
 HEADERS= \
 MacOS.h \
@@ -480,7 +484,8 @@ sintab.o
 
 $(PROGRAM):  $(OBJS) $(AUDIO_OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(SOAPYSDR_OBJS) \
                $(LOCALCW_OBJS) $(PURESIGNAL_OBJS) \
-               $(MIDI_OBJS) $(STEMLAB_OBJS) $(SERVER_OBJS)
+               $(MIDI_OBJS) $(STEMLAB_OBJS) $(SERVER_OBJS) \
+               libhpsdr
        $(LINK) -o $(PROGRAM) $(OBJS) $(AUDIO_OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) \
                $(SOAPYSDR_OBJS) $(LOCALCW_OBJS) $(PURESIGNAL_OBJS) \
                $(MIDI_OBJS) $(STEMLAB_OBJS) $(SERVER_OBJS) $(LIBS)
@@ -569,7 +574,7 @@ controller2v2: clean $(PROGRAM)
 
 hpsdrsim.o:     hpsdrsim.c  hpsdrsim.h
        $(CC) -c -O hpsdrsim.c
-       
+
 newhpsdrsim.o: newhpsdrsim.c hpsdrsim.h
        $(CC) -c -O newhpsdrsim.c
 
@@ -597,6 +602,10 @@ debian:
        cp release/pihpsdr/pihpsdr.desktop pkg/pihpsdr/usr/share/applications
        cd pkg; dpkg-deb --build pihpsdr
 
+libhpsdr:
+       cd rust && \
+       cargo build && \
+       cd ..
 #############################################################################
 #
 # This is for MacOS "app" creation ONLY
diff --git a/main.c b/main.c
index bf07745c3db5295243dd7e9fefa0ee14d99ae841..f2809680ff582c2720474048b65f53add31cb33e 100644 (file)
--- a/main.c
+++ b/main.c
@@ -70,6 +70,8 @@ gint display_width;
 gint display_height;
 gint full_screen=1;
 
+extern size_t add(size_t left, size_t right);
+
 static GtkWidget *discovery_dialog;
 
 static GdkCursor *cursor_arrow;
@@ -347,6 +349,8 @@ int main(int argc,char **argv) {
 
   char name[1024];
 
+  printf("calling rust add fn: %d\n", add(40, 2));
+
 #ifdef __APPLE__
   void MacOSstartup(char *path);
   MacOSstartup(argv[0]);