]> git.stg.codes - stg.git/blobdiff - projects/stargazer/Makefile
Merge branch 'stg-2.409-radius'
[stg.git] / projects / stargazer / Makefile
index 44ae35ec3007ebae87f6cef197526972043ae013..e127d4f8a4eb27e9f07b6e7ab24b9485c1475942 100644 (file)
@@ -13,6 +13,7 @@ SRCS = ./admin_impl.cpp \
        ./main.cpp \
        ./pidfile.cpp \
        ./plugin_runner.cpp \
+       ./plugin_mgr.cpp \
        ./settings_impl.cpp \
        ./services_impl.cpp \
        ./stg_timer.cpp \
@@ -26,19 +27,18 @@ SRCS = ./admin_impl.cpp \
 
 STGLIBS = scriptexecuter \
           dotconfpp \
-         locker \
          logger \
          common
 
 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
 
-LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD)
+LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV)
 
 ifeq ($(OS),linux)
 LIBS += -ldl
 else
-LIBS += -lc -liconv
+LIBS += -lc
 endif
 
 SEARCH_DIRS = -I ../../include
@@ -47,7 +47,12 @@ OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
 
 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
-LDFLAGS += -Wl,-E $(STGLIBS_LIBS)
+
+ifneq ($(OS),darwin)
+LDFLAGS += -Wl,-E
+endif
+
+LDFLAGS += $(STGLIBS_LIBS)
 
 .PHONY: all clean distclean libs plugins install uninstall install-bin install-data
 all: libs plugins $(PROG)
@@ -77,7 +82,13 @@ distclean: clean
 install: install-bin install-data
 
 install-bin: $(PROG)
+ifeq ($(DEBUG), yes)
+       mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
+       install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
+else
+       mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
        install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
+endif
        $(MAKE) -C $(DIR_INCLUDE) install
        $(MAKE) -C $(DIR_LIBSRC) install
        $(MAKE) -C $(DIR_PLUGINS) install