From 80c2dd1d09481f95523bcad298f1372d9b555671 Mon Sep 17 00:00:00 2001
From: Jake Drahos <j@kedrahos.com>
Date: Sun, 5 Mar 2017 18:24:43 -0600
Subject: [PATCH] Added frontend library

---
 groundStation/Makefile                       |  5 ++++-
 groundStation/src/frontend/frontend_common.h | 10 +++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/groundStation/Makefile b/groundStation/Makefile
index 052f6bf8a..873685d62 100644
--- a/groundStation/Makefile
+++ b/groundStation/Makefile
@@ -34,13 +34,16 @@ FECOBJECTS = $(FECSOURCES:$(FESRCDIR)/%.c=$(OBJDIR)/%.o)
 OBJECTS= $(CLIOBJECTS) $(BECOBJECTS) $(BECPPOBJECTS) $(FECOBJECTS)
 
 # Default target
-all: logs objdir backend cli $(SYMLINKS)
+all: logs objdir backend cli $(SYMLINKS) frontend.a
 
 $(SYMLINKS): $(CLIBINARY)
 	$(foreach symlink, $(SYMLINKS), ln -s $(CLIBINARY) $(symlink);)
 
 vrpn: vrpn/build
 
+frontend.a: $(FECOBJECTS)
+	ar rvs frontend.a $(wildcard $(OBJDIR)/frontend_*.o)
+
 cli:  $(CLIOBJECTS) $(FECOBJECTS)
 	$(GCC) $(CFLAGS) $^ -o $(CLIBINARY) $(INCLUDES) $(LIBS)
 
diff --git a/groundStation/src/frontend/frontend_common.h b/groundStation/src/frontend/frontend_common.h
index 60ee33626..ee0e923bb 100644
--- a/groundStation/src/frontend/frontend_common.h
+++ b/groundStation/src/frontend/frontend_common.h
@@ -2,6 +2,10 @@
 #define __FRONTEND_COMMON_H
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct backend_conn;
 
 /* Start connection to quad */
@@ -19,4 +23,8 @@ char * ucart_backendGetline(struct backend_conn * conn);
 /* Write a line to the backend */
 int ucart_backendWrite(struct backend_conn * backend, const char * line);
 
-#endif /* __FRONTEND_COMMON_H */
\ No newline at end of file
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __FRONTEND_COMMON_H */
-- 
GitLab