fix build system

Sun, 16 Apr 2023 14:12:24 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 16 Apr 2023 14:12:24 +0200
changeset 746
a569148841ff
parent 745
aea83a43b09a
child 747
efbd59642577

fix build system

configure file | annotate | diff | comparison | revisions
dav/Makefile file | annotate | diff | comparison | revisions
libidav/Makefile file | annotate | diff | comparison | revisions
make/project.xml file | annotate | diff | comparison | revisions
--- a/configure	Sun Apr 16 14:08:19 2023 +0200
+++ b/configure	Sun Apr 16 14:12:24 2023 +0200
@@ -459,7 +459,7 @@
     while true
     do
         
-        LDFLAGS="$LDFLAGS -lpthread"    
+        LDFLAGS="$LDFLAGS -lm -lpthread"    
         
         break
     done
--- a/dav/Makefile	Sun Apr 16 14:08:19 2023 +0200
+++ b/dav/Makefile	Sun Apr 16 14:12:24 2023 +0200
@@ -26,9 +26,9 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-CONF=gcc
-include ../$(CONF).mk
-include ../cppcheck.mk
+BUILD_ROOT = ..
+
+include ../config.mk
 
 DAV_SRC  = main.c
 DAV_SRC += config.c
@@ -61,26 +61,29 @@
 SYNC_OBJ = $(SYNC_SRC:%.c=../build/tool/%$(OBJ_EXT))
 XATTR_OBJ = $(XATTR_SRC:%.c=../build/tool/%$(OBJ_EXT))
 
-
-all: ../build/dav ../build/dav-sync ../build/xattrtool
+DAV_BIN = ../build/bin/dav$(APP_EXT)
+DAV_SYNC_BIN = ../build/bin/dav-sync$(APP_EXT)
+XATTRTOOL_BIN = ../build/bin/xattrtool$(APP_EXT)
 
-../build/dav: $(DAV_OBJ) ../build/libidav$(LIB_EXT)
-	$(LD) -o ../build/dav$(APP_EXT) $(DAV_OBJ) \
+all: ../build/bin/dav ../build/bin/dav-sync ../build/bin/xattrtool
+
+$(DAV_BIN): $(DAV_OBJ) ../build/libidav$(LIB_EXT)
+	$(LD) -o $(DAV_BIN) $(DAV_OBJ) \
 		../build/libidav$(LIB_EXT) ../build/libucx$(LIB_EXT)  \
 		$(LDFLAGS) $(DAV_LDFLAGS)
 
-../build/dav-sync: $(SYNC_OBJ) ../build/libidav$(LIB_EXT)
-	$(LD) -o ../build/dav-sync$(APP_EXT) $(SYNC_OBJ) \
+$(DAV_SYNC_BIN): $(SYNC_OBJ) ../build/libidav$(LIB_EXT)
+	$(LD) -o $(DAV_SYNC_BIN) $(SYNC_OBJ) \
 		../build/libidav$(LIB_EXT) ../build/libucx$(LIB_EXT)  \
 		$(LDFLAGS) $(DAV_LDFLAGS)
 
-../build/xattrtool: $(XATTR_OBJ)
-	$(LD) -o ../build/xattrtool$(APP_EXT) $(XATTR_OBJ) $(LDFLAGS)
+$(XATTRTOOL_BIN): $(XATTR_OBJ)
+	$(LD) -o $(XATTRTOOL_BIN) $(XATTR_OBJ) $(LDFLAGS)
 
 ../build/tool/%$(OBJ_EXT): %.c 
-	$(CC) $(CFLAGS) $(DAV_CFLAGS) -I../ -I../ucx/ -o $@ $<
+	$(CC) $(CFLAGS) $(DAV_CFLAGS) -I../ -I../ucx -c -o $@ $<
 
 
 cppcheck: $(DAV_SRC) $(SYNC_SRC)
-	$(CPPCHECK) $(CPPCHECK_CONFIG) $(CPPCHECK_FLAGS) -I../ -I../ucx -I../ $+ 2>> ../$(CPPCHECK_LOG)
+	$(CPPCHECK) $(CPPCHECK_CONFIG) $(CPPCHECK_FLAGS) -I../ucx -I../ $+ 2>> ../$(CPPCHECK_LOG)
 
--- a/libidav/Makefile	Sun Apr 16 14:08:19 2023 +0200
+++ b/libidav/Makefile	Sun Apr 16 14:12:24 2023 +0200
@@ -26,9 +26,9 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-CONF=gcc
-include ../$(CONF).mk
-include ../cppcheck.mk
+BUILD_ROOT = ..
+
+include ../config.mk
 
 # list of source files
 SRC  = webdav.c
@@ -50,7 +50,7 @@
 	$(AR) $(ARFLAGS) $(AOFLAGS)../build/libidav$(LIB_EXT) $(OBJ)
 
 ../build/libidav/%$(OBJ_EXT): %.c
-	$(CC) -I../ucx/  $(CFLAGS) $(DAV_CFLAGS) $(COFLAGS)$@ $<
+	$(CC) $(CFLAGS) $(DAV_CFLAGS) -I.. -I../ucx -c -o $@ $<
 
 cppcheck: $(SRC)
 	$(CPPCHECK) $(CPPCHECK_CONFIG) $(CPPCHECK_FLAGS) -I../ucx $+ 2>> ../$(CPPCHECK_LOG)
--- a/make/project.xml	Sun Apr 16 14:08:19 2023 +0200
+++ b/make/project.xml	Sun Apr 16 14:12:24 2023 +0200
@@ -47,7 +47,7 @@
 	</dependency>
 
 	<dependency>
-		<ldflags>-lpthread</ldflags>
+		<ldflags>-lm -lpthread</ldflags>
 	</dependency>
 	
 	<dependency platform="bsd" not="macos">

mercurial