X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/9dbaa1f22054ff5492e793259d5641b876b57ac1..28e7683d83570df1fc6b44a74e8eb0782b8bd9a2:/projects/sgauthstress/Makefile

diff --git a/projects/sgauthstress/Makefile b/projects/sgauthstress/Makefile
index 9d5e94cd..4415220f 100644
--- a/projects/sgauthstress/Makefile
+++ b/projects/sgauthstress/Makefile
@@ -8,15 +8,14 @@ SRCS = main.cpp \
        user.cpp \
        proto.cpp
 
-STGLIBS = crypto \
-          common \
-          dotconfpp \
-	  locker
+STGLIBS = dotconfpp \
+          crypto \
+          common
 
 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
 
-LIBS += $(LIB_THREAD) $(addprefix -lstg,$(STGLIBS))
+LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV)
 
 ifeq ($(OS),linux)
 LIBS += -ldl
@@ -31,7 +30,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
 all: libs plugins $(PROG) ../../Makefile.conf
@@ -39,7 +43,7 @@ all: libs plugins $(PROG) ../../Makefile.conf
 libs:
 	$(MAKE) -C $(DIR_LIBSRC)
 
-plugins: libs 
+plugins: libs
 	$(MAKE) -C $(DIR_PLUGINS)
 
 $(PROG): $(OBJS)
@@ -65,6 +69,13 @@ deps:	$(SRCS) ../../Makefile.conf
 	$(MAKE) -C $(DIR_LIBSRC)
 	@>deps ;\
 	for file in $(SRCS); do\
-	  echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
-	  echo -e '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
+	  echo "$$file" | grep ".c$$" > /dev/null;\
+	  if [ $$? -eq 0 ];\
+	  then\
+	    echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
+	    printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
+	  else\
+	    echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
+	    printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
+	  fi;\
 	done