소스 검색

Small fixes in Makefile

bel2125 9 년 전
부모
커밋
63ef9cbd35
3개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 0
      Makefile
  2. 1 1
      examples/embedded_c/Makefile
  3. 3 2
      examples/embedded_c/embedded_c.c

+ 1 - 0
Makefile

@@ -248,6 +248,7 @@ clean:
 	$(RMRF) $(BUILD_DIR)
 	$(RMRF) $(BUILD_DIR)
 	$(eval version=$(shell grep "define CIVETWEB_VERSION" include/civetweb.h | sed 's|.*VERSION "\(.*\)"|\1|g'))
 	$(eval version=$(shell grep "define CIVETWEB_VERSION" include/civetweb.h | sed 's|.*VERSION "\(.*\)"|\1|g'))
 	$(eval major=$(shell echo $(version) | cut -d'.' -f1))
 	$(eval major=$(shell echo $(version) | cut -d'.' -f1))
+	$(RMRF) lib$(CPROG).a
 	$(RMRF) lib$(CPROG).so
 	$(RMRF) lib$(CPROG).so
 	$(RMRF) lib$(CPROG).so.$(major)
 	$(RMRF) lib$(CPROG).so.$(major)
 	$(RMRF) lib$(CPROG).so.$(version).0
 	$(RMRF) lib$(CPROG).so.$(version).0

+ 1 - 1
examples/embedded_c/Makefile

@@ -12,7 +12,7 @@ SRC = embedded_c.c
 TOP = ../..
 TOP = ../..
 CIVETWEB_LIB = libcivetweb.a
 CIVETWEB_LIB = libcivetweb.a
 
 
-CFLAGS = -I$(TOP)/include $(COPT) -DUSE_WEBSOCKET
+CFLAGS = -I$(TOP)/include $(COPT) -DUSE_WEBSOCKET -DUSE_IPV6
 LIBS = -lpthread
 LIBS = -lpthread
 
 
 include $(TOP)/resources/Makefile.in-os
 include $(TOP)/resources/Makefile.in-os

+ 3 - 2
examples/embedded_c/embedded_c.c

@@ -17,7 +17,7 @@
 
 
 #define DOCUMENT_ROOT "."
 #define DOCUMENT_ROOT "."
 #ifdef USE_IPV6
 #ifdef USE_IPV6
-#define PORT "8888,[::]:8888"
+#define PORT "8888,[::]:8886"
 #else
 #else
 #define PORT "8888"
 #define PORT "8888"
 #endif
 #endif
@@ -251,7 +251,7 @@ int main(int argc, char *argv[])
     struct mg_callbacks callbacks;
     struct mg_callbacks callbacks;
     struct mg_context *ctx;
     struct mg_context *ctx;
     struct mg_server_ports ports[32];
     struct mg_server_ports ports[32];
-    size_t port_cnt, n;
+    int port_cnt, n;
 
 
     memset(&callbacks, 0, sizeof(callbacks));
     memset(&callbacks, 0, sizeof(callbacks));
     ctx = mg_start(&callbacks, 0, options);
     ctx = mg_start(&callbacks, 0, options);
@@ -282,6 +282,7 @@ int main(int argc, char *argv[])
     
     
     memset(ports, 0, sizeof(ports));    
     memset(ports, 0, sizeof(ports));    
     port_cnt = mg_get_server_ports(ctx, 32, ports);
     port_cnt = mg_get_server_ports(ctx, 32, ports);
+    printf("\n%i listening ports:\n\n", port_cnt);
 
 
     for (n=0; n<port_cnt && n<32; n++) {
     for (n=0; n<port_cnt && n<32; n++) {
         const char *proto = ports[n].is_ssl ? "https" : "http";
         const char *proto = ports[n].is_ssl ? "https" : "http";