X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/f1f23b0047bf11eb8f904f4da4e5cc2bb236bf06..b4624e20e132b7a113bd450174a505419c5b34b8:/projects/stargazer/plugins/Makefile.in diff --git a/projects/stargazer/plugins/Makefile.in b/projects/stargazer/plugins/Makefile.in index faee2ad8..36aebbef 100644 --- a/projects/stargazer/plugins/Makefile.in +++ b/projects/stargazer/plugins/Makefile.in @@ -8,16 +8,24 @@ OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) LN = ln -CXXFLAGS += -fPIC -CFLAGS += -fPIC -LDFLAGS += -shared -L$(DIR_LIB) -Wl,-rpath,$(PREFIX)/usr/lib/stg +STGLIBS_INCS = $(addprefix -I ../../../../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) +STGLIBS_PATHS = $(addprefix -L ../../../../../stglibs/,$(addsuffix .lib,$(STGLIBS))) -vpath %.a $(DIR_LIB) +STGLIBS_LIBS = $(addprefix -lstg,$(STGLIBS)) + +CXXFLAGS += -fPIC $(DEFS) $(SEARCH_DIRS) $(STGLIBS_INCS) +CFLAGS += -fPIC $(DEFS) $(SEARCH_DIRS) $(STGLIBS_INCS) + +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) $(STGLIBS) - $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG) +$(PROG): $(OBJS) + $(CXX) $^ $(LDFLAGS) $(STGLIBS_PATHS) $(STGLIBS_LIBS) $(LIBS) -o $(PROG) $(LN) -fs "`pwd`/$(PROG)" $(DIR_MOD)/$(PROG) clean: @@ -25,7 +33,11 @@ clean: install: $(PROG) mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg +ifeq ($(DEBUG), yes) + install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/stg/$(PROG) +else install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG) +endif uninstall: rm -f $(PREFIX)/usr/lib/stg/$(PROG) @@ -40,12 +52,12 @@ deps: $(SRCS) ../../../../../Makefile.conf @>deps ;\ for file in $(SRCS); do\ echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? == 0 ];\ + if [ $$? -eq 0 ];\ then\ echo "`$(CC) $(CFLAGS) $(DEFS) $(SEARCH_DIRS) -MM $$file` Makefile ../../../../../Makefile.conf" >> deps ;\ - echo -e '\t$$(CC) -c $$< $(CFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\ + printf '%b\n' '\t$$(CC) -c $$< $(CFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\ else\ echo "`$(CXX) $(CXXFLAGS) $(DEFS) $(SEARCH_DIRS) -MM $$file` Makefile ../../../../../Makefile.conf" >> deps ;\ - echo -e '\t$$(CXX) -c $$< $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\ + printf '%b\n' '\t$$(CXX) -c $$< $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\ fi;\ - done; + done