From a599ccb0ef3afa2852f32dfa91b4faf8a3d606e1 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Fri, 10 Feb 2023 11:23:43 +0100 Subject: [PATCH] improve buidl system; added all and install targets --- Makefile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index dcdd379..bf5ad06 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,25 @@ CPP_STANDARD := c++17 CXXFLAGS := -O3 -fPIC -std=$(CPP_STANDARD) +ifeq ($(strip $(PREFIX)),) +PREFIX:=. +endif -.PHONY: clean +.DEFAULT_GOAL := all +.PHONY: clean all install -emulator_interface.so: emulator.cc emulator.h +EMULATOR_LIB:=libemulator_interface.so +all: $(EMULATOR_LIB) + @echo All done + +install: all + @rm -rf $(PREFIX)/include $(PREFIX)/lib64 + @mkdir -p $(PREFIX)/include $(PREFIX)/lib64 + cp emulator.h $(PREFIX)/include/ + cp -r ap_types $(PREFIX)/include/ + cp $(EMULATOR_LIB) $(PREFIX)/lib64 + +$(EMULATOR_LIB): emulator.cc emulator.h $(CXX) $(CXXFLAGS) -shared $^ -o $@ clean: - rm emulator_interface.so \ No newline at end of file + rm $(EMULATOR_LIB)