diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 66b88d3..6c65e75 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,3 +45,14 @@ jobs: cd ${GITHUB_WORKSPACE}/integrationTest make clean-all > /dev/null ./run.sh + + - name: Install Runtime + run: | + cd ${GITHUB_WORKSPACE} + git submodule update --init + cd ${GITHUB_WORKSPACE}/runtime + make clean-all + make -j10 + sudo make install + cd ${GITHUB_WORKSPACE}/sample + make sampleApplication_system diff --git a/runtime/GNUmakefile b/runtime/GNUmakefile index 8691fa7..e8be5ec 100644 --- a/runtime/GNUmakefile +++ b/runtime/GNUmakefile @@ -64,7 +64,16 @@ clean: clean-all: clean rm -f libgtest.a testHelper/GeneratedCode.cc - + +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif +install: libNanoLog.a + install -d $(DESTDIR)$(PREFIX)/lib/ + install -m 644 libNanoLog.a $(DESTDIR)$(PREFIX)/lib/ + install -d $(DESTDIR)$(PREFIX)/include/NanoLog/ + install -m 644 *.h $(DESTDIR)$(PREFIX)/include/NanoLog/ + install -m 755 decompressor $(DESTDIR)$(PREFIX)/bin/ # Automatic rules to build *.h dependencies. Taken from # https://stackoverflow.com/questions/2394609/makefile-header-dependencies depend: .depend @@ -74,3 +83,4 @@ depend: .depend $(CXX) $(CXX_ARGS) $(INCLUDES) -MM $^ > ./.depend; include .depend + diff --git a/sample/GNUmakefile b/sample/GNUmakefile index f3a6450..db2d4fe 100644 --- a/sample/GNUmakefile +++ b/sample/GNUmakefile @@ -43,3 +43,9 @@ decompressor: libNanoLog.a clean-all: clean @rm -f libNanoLog.a decompressor $(MAKE) clean-all -C $(NANOLOG_RUNTIME_DIR) + +main-install.o: main.cc + $(CXX) -I /usr/local/include/NanoLog/ -c -o $@ $< $(CXXFLAGS) + +sampleApplication_system: main-install.o + $(CXX) $(CXXFLAGS) -o sampleApplication main-install.o -L/usr/local/lib/ -lNanoLog -pthread -lrt