diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ac3f100..168ca95 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,7 +12,10 @@ "ENABLE_DEBUG=1", "USE_GPSD=1" ], - "group": "build", + "group": { + "kind": "build", + "isDefault": true + }, "problemMatcher": [] }, { @@ -25,10 +28,7 @@ "ENABLE_DEBUG=1", "USE_GPSD=1" ], - "group": { - "kind": "build", - "isDefault": true - }, + "group": "build", "problemMatcher": [] } ] diff --git a/CCITTChecksum.cpp b/BaseCommon/CCITTChecksum.cpp similarity index 100% rename from CCITTChecksum.cpp rename to BaseCommon/CCITTChecksum.cpp diff --git a/CCITTChecksum.h b/BaseCommon/CCITTChecksum.h similarity index 100% rename from CCITTChecksum.h rename to BaseCommon/CCITTChecksum.h diff --git a/Config.cpp b/BaseCommon/Config.cpp similarity index 100% rename from Config.cpp rename to BaseCommon/Config.cpp diff --git a/Config.h b/BaseCommon/Config.h similarity index 100% rename from Config.h rename to BaseCommon/Config.h diff --git a/Log.cpp b/BaseCommon/Log.cpp similarity index 100% rename from Log.cpp rename to BaseCommon/Log.cpp diff --git a/Log.h b/BaseCommon/Log.h similarity index 100% rename from Log.h rename to BaseCommon/Log.h diff --git a/LogConsoleTarget.cpp b/BaseCommon/LogConsoleTarget.cpp similarity index 100% rename from LogConsoleTarget.cpp rename to BaseCommon/LogConsoleTarget.cpp diff --git a/LogConsoleTarget.h b/BaseCommon/LogConsoleTarget.h similarity index 100% rename from LogConsoleTarget.h rename to BaseCommon/LogConsoleTarget.h diff --git a/LogFileTarget.cpp b/BaseCommon/LogFileTarget.cpp similarity index 100% rename from LogFileTarget.cpp rename to BaseCommon/LogFileTarget.cpp diff --git a/LogFileTarget.h b/BaseCommon/LogFileTarget.h similarity index 100% rename from LogFileTarget.h rename to BaseCommon/LogFileTarget.h diff --git a/LogSeverity.h b/BaseCommon/LogSeverity.h similarity index 100% rename from LogSeverity.h rename to BaseCommon/LogSeverity.h diff --git a/LogTarget.cpp b/BaseCommon/LogTarget.cpp similarity index 100% rename from LogTarget.cpp rename to BaseCommon/LogTarget.cpp diff --git a/LogTarget.h b/BaseCommon/LogTarget.h similarity index 100% rename from LogTarget.h rename to BaseCommon/LogTarget.h diff --git a/BaseCommon/Makefile b/BaseCommon/Makefile new file mode 100644 index 0000000..dc769f0 --- /dev/null +++ b/BaseCommon/Makefile @@ -0,0 +1,12 @@ +SRCS = $(wildcard *.cpp) +OBJS = $(SRCS:.cpp=.o) +DEPS = $(SRCS:.cpp=.d) + +BaseCommon.a: $(OBJS) + $(AR) rcs BaseCommon.a $(OBJS) + +%.o : %.cpp + $(CC) $(CPPFLAGS) -MMD -MD -c $< -o $@ + +clean: + $(RM) *.o *.d BaseCommon.a \ No newline at end of file diff --git a/NetUtils.cpp b/BaseCommon/NetUtils.cpp similarity index 100% rename from NetUtils.cpp rename to BaseCommon/NetUtils.cpp diff --git a/NetUtils.h b/BaseCommon/NetUtils.h similarity index 100% rename from NetUtils.h rename to BaseCommon/NetUtils.h diff --git a/RingBuffer.h b/BaseCommon/RingBuffer.h similarity index 100% rename from RingBuffer.h rename to BaseCommon/RingBuffer.h diff --git a/SHA256.cpp b/BaseCommon/SHA256.cpp similarity index 100% rename from SHA256.cpp rename to BaseCommon/SHA256.cpp diff --git a/SHA256.h b/BaseCommon/SHA256.h similarity index 100% rename from SHA256.h rename to BaseCommon/SHA256.h diff --git a/StringUtils.cpp b/BaseCommon/StringUtils.cpp similarity index 100% rename from StringUtils.cpp rename to BaseCommon/StringUtils.cpp diff --git a/StringUtils.h b/BaseCommon/StringUtils.h similarity index 100% rename from StringUtils.h rename to BaseCommon/StringUtils.h diff --git a/Thread.cpp b/BaseCommon/Thread.cpp similarity index 100% rename from Thread.cpp rename to BaseCommon/Thread.cpp diff --git a/Thread.h b/BaseCommon/Thread.h similarity index 100% rename from Thread.h rename to BaseCommon/Thread.h diff --git a/Timer.cpp b/BaseCommon/Timer.cpp similarity index 100% rename from Timer.cpp rename to BaseCommon/Timer.cpp diff --git a/Timer.h b/BaseCommon/Timer.h similarity index 100% rename from Timer.h rename to BaseCommon/Timer.h diff --git a/Utils.cpp b/BaseCommon/Utils.cpp similarity index 100% rename from Utils.cpp rename to BaseCommon/Utils.cpp diff --git a/Utils.h b/BaseCommon/Utils.h similarity index 100% rename from Utils.h rename to BaseCommon/Utils.h diff --git a/Makefile b/Makefile index 86bc984..97b259f 100644 --- a/Makefile +++ b/Makefile @@ -45,11 +45,14 @@ DEPS = $(SRCS:.cpp=.d) .PHONY: all all: dstargateway -dstargateway : GitVersion.h $(OBJS) - $(CC) $(CPPFLAGS) -o dstargateway $(OBJS) $(LDFLAGS) +dstargateway : GitVersion.h $(OBJS) BaseCommon/BaseCommon.a + $(CC) $(CPPFLAGS) -o dstargateway $(OBJS) BaseCommon/BaseCommon.a $(LDFLAGS) %.o : %.cpp - $(CC) $(CPPFLAGS) -MMD -MD -c $< -o $@ + $(CC) -IBaseCommon/ $(CPPFLAGS) -MMD -MD -c $< -o $@ + +BaseCommon/BaseCommon.a: FORCE + $(MAKE) -C BaseCommon GitVersion.h : FORCE ifneq ("$(wildcard .git/index)","") @@ -71,8 +74,9 @@ endif .PHONY: clean clean: - @$(RM) GitVersion.h $(OBJS) $(DEPS) dstargateway - @$(MAKE) -C Tests clean + $(RM) GitVersion.h *.o *.d dstargateway + $(MAKE) -C Tests clean + $(MAKE) -C BaseCommon clean -include $(DEPS)