X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b4338eb13c4c5fa33a3b86d4e88e5201c36e6401..94ed11aed11d6eae5797205bd808efddd32778e7:/projects/sgauthstress/Makefile

diff --git a/projects/sgauthstress/Makefile b/projects/sgauthstress/Makefile
index 9236317d..74c09b62 100644
--- a/projects/sgauthstress/Makefile
+++ b/projects/sgauthstress/Makefile
@@ -9,21 +9,19 @@ SRCS = main.cpp \
        proto.cpp
 
 STGLIBS = dotconfpp \
-	  locker \
-	  crypto \
-	  common
+          crypto \
+          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 += -lintl \
-        -lc \
-	-liconv
+        -lc
 endif
 
 SEARCH_DIRS = -I ../../include
@@ -40,7 +38,7 @@ all: libs plugins $(PROG) ../../Makefile.conf
 libs:
 	$(MAKE) -C $(DIR_LIBSRC)
 
-plugins: libs 
+plugins: libs
 	$(MAKE) -C $(DIR_PLUGINS)
 
 $(PROG): $(OBJS)
@@ -66,6 +64,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