X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/2501ff5278198b17c195536d0953cbb40d1a5d3b..9a834ba2e0caea6edffec5c1db403cf9832ea96e:/projects/stargazer/plugins/Makefile.in diff --git a/projects/stargazer/plugins/Makefile.in b/projects/stargazer/plugins/Makefile.in index 17e10ace..dd1e124a 100644 --- a/projects/stargazer/plugins/Makefile.in +++ b/projects/stargazer/plugins/Makefile.in @@ -9,18 +9,23 @@ OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) LN = ln STGLIBS_INCS = $(addprefix -I ../../../../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) -STGLIBS_LIBS = $(addprefix -L ../../../../../stglibs/,$(addsuffix .lib,$(STGLIBS))) +STGLIBS_PATHS = $(addprefix -L ../../../../../stglibs/,$(addsuffix .lib,$(STGLIBS))) -LIBS += $(addprefix -lstg,$(STGLIBS)) +STGLIBS_LIBS = $(addprefix -lstg,$(STGLIBS)) CXXFLAGS += -fPIC $(STGLIBS_INCS) CFLAGS += -fPIC $(STGLIBS_INCS) -LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg $(STGLIBS_LIBS) + +ifneq ($(OS),darwin) +LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg +else +LDFLAGS += -dynamiclib -undefined suppress -flat_namespace -Wl,-rpath,$(PREFIX)/usr/lib/stg +endif all: $(PROG) $(PROG): $(OBJS) - $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG) + $(CXX) $^ $(STGLIBS_PATHS) $(STGLIBS_LIBS) $(LIBS) $(LDFLAGS) -o $(PROG) $(LN) -fs "`pwd`/$(PROG)" $(DIR_MOD)/$(PROG) clean: @@ -28,7 +33,11 @@ clean: install: $(PROG) mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG) +ifeq ($(DEBUG), yes) + install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/stg/$(PROG) +else + install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG) +endif uninstall: rm -f $(PREFIX)/usr/lib/stg/$(PROG)