From: nishi Date: Wed, 17 Jan 2024 08:29:52 +0000 (+0000) Subject: debug X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ca69fcfec27cd468979c72383e5a1c3395afd400;p=libw3.git debug git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@10 d27a3e52-49c5-7645-884c-6793ebffc270 --- diff --git a/Example/Makefile b/Example/Makefile index 834103f..14a4226 100644 --- a/Example/Makefile +++ b/Example/Makefile @@ -5,7 +5,7 @@ $(CC) -o $@ -I ../Library -L ../Library $< -lw3 clean: - rm -f fetch *.o *.so *.core + rm -f fetch *.o *.so *.core *~ install: ./fetch mkdir -p $(PREFIX)/bin diff --git a/Library/Makefile b/Library/Makefile index 307b964..08147f6 100644 --- a/Library/Makefile +++ b/Library/Makefile @@ -8,7 +8,7 @@ $(CC) $(CFLAGS) -c -o $@ $< clean: - rm -f *.o *.so *.core + rm -f *.o *.so *.core *~ install: ./libw3.so mkdir -p $(PREFIX)/lib diff --git a/Library/Util.c b/Library/Util.c index a1ebd9c..906e279 100644 --- a/Library/Util.c +++ b/Library/Util.c @@ -15,3 +15,11 @@ void __W3_Debug(const char* title, const char* message){ fprintf(stderr, "%s%s %s\n", title, periods, message); #endif } + +char* __W3_Concat(const char* str1, const char* str2){ + char* str = malloc(strlen(str1) + strlen(str2) + 1); + strcpy(str, str1); + strcpy(str + strlen(str1), str2); + str[strlen(str1) + strlen(str2)] = 0; + return str; +} diff --git a/Library/W3Util.h b/Library/W3Util.h index 94bef34..9eefd88 100644 --- a/Library/W3Util.h +++ b/Library/W3Util.h @@ -3,5 +3,6 @@ #define __W3UTIL_H__ void __W3_Debug(const char* title, const char* message); +char* __W3_Concat(const char* str1, const char* str2); #endif diff --git a/Makefile b/Makefile index 7a76b1f..f060b86 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ include config.mk CC := cc -CFLAGS := -g -std=c99 -fPIC -D_BSD_SOURCE +CFLAGS := -g -std=c99 -fPIC -D_BSD_SOURCE $(DEBUG) LDFLAGS := LIBS := PREFIX := /usr/local @@ -12,10 +12,6 @@ CFLAGS += -DSSL_SUPPORT LIBS += -lssl -lcrypto endif -ifdef DEBUG -CFLAGS += -D__DEBUG__ -endif - .PHONY: all clean ./Library/libw3.so ./Example/fetch all: ./w3.pc ./Library/libw3.so ./Example/fetch @@ -39,7 +35,7 @@ all: ./w3.pc ./Library/libw3.so ./Example/fetch echo "Libs: -I\$${libdir} -lw3" >> $@ clean: - rm ./w3.pc + -rm ./w3.pc $(MAKE) -C ./Library clean $(MAKE) -C ./Example clean