From 77d547596c23d5878fee417d3aa0a3bf38037e65 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 21 Aug 2025 15:26:11 -0400 Subject: Makefile: add install and uninstall targets --- Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0454bb4..6685083 100644 --- a/Makefile +++ b/Makefile @@ -252,6 +252,12 @@ $(DIR_OBJ)/libpke-test.$(LIB_EXT): $(DIR_OBJ)/pke-test-serialization.$(OBJ_EXT) $(DIR_OBJ)/libpke-test.$(LIB_EXT): $(DIR_OBJ)/pke-test-asset-manager.$(OBJ_EXT) ar rcs $@ $(filter %.$(OBJ_EXT),$^) +$(DIR_OBJ)/libpke-runtime.$(LIB_EXT): $(DIR_OBJ)/libpke.$(LIB_EXT) +$(DIR_OBJ)/libpke-runtime.$(LIB_EXT): $(DIR_OBJ)/libpke-imgui.$(LIB_EXT) +$(DIR_OBJ)/libpke-runtime.$(LIB_EXT): $(DIR_OBJ)/libpke-bullet3.$(LIB_EXT) +$(DIR_OBJ)/libpke-runtime.$(LIB_EXT): + libtool --tag=CXX --mode=link $(CC) -o $@ $^ --static + $(DIR_EXE)/pke-editor: $(DIR_OBJ)/libpke-editor.$(LIB_EXT) $(DIR_EXE)/pke-editor: $(DIR_OBJ)/libpke.$(LIB_EXT) $(DIR_EXE)/pke-editor: $(DIR_OBJ)/libpke-imgui.$(LIB_EXT) @@ -282,4 +288,17 @@ clean: rm -f *.o *.so *.plist config.h $(FILES_BIN_GCH) rm -rf ./$(DIR_EXE_release) ./$(DIR_EXE_release-debug) ./$(DIR_EXE_debug) ./$(DIR_OBJ) -.PHONY: dist install uninstall +.PHONY: install +install: bin/pke-runtime obj/libpke-runtime.a obj/libpke-editor.o + mkdir -p $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(PREFIX)/lib/pke + cp -f bin/pke-runtime $(DESTDIR)$(PREFIX)/bin + cp -f obj/libpke-runtime.a $(DESTDIR)$(PREFIX)/lib/pke + cp -f obj/libpke-editor.o $(DESTDIR)$(PREFIX)/lib/pke + chmod 755 $(DESTDIR)$(PREFIX)/bin/pke-runtime + chmod 755 $(DESTDIR)$(PREFIX)/lib/pke/libpke-runtime.a + chmod 755 $(DESTDIR)$(PREFIX)/lib/pke/libpke-editor.o + +.PHONY: uninstall +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/st -- cgit v1.2.3