--- a/Makefile Sat Mar 25 17:23:09 2023 +0100 +++ b/Makefile Sun Apr 16 14:08:19 2023 +0200 @@ -1,7 +1,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -# Copyright 2018 Olaf Wintermann. All rights reserved. +# Copyright 2011 Olaf Wintermann. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -26,69 +26,59 @@ # POSSIBILITY OF SUCH DAMAGE. # - -# -# available configurations: -# gcc -# clang -# suncc -# mingw -# osx -# bsd -# - -CONF=gcc PREFIX=/usr -include $(CONF).mk -include cppcheck.mk +all: config.mk build/bin build/lib build/ucx build/dav build/libidav build/test build/tool ucx libidav dav test + +ucx: FORCE + cd ucx; $(MAKE) all -all: build/tool build/ucx build/libidav build/test ucx libidav dav test +libidav: build/bin build/lib build/dav build/libidav build/tool FORCE + cd libidav; $(MAKE) all + +dav: FORCE build/bin build/lib build/dav build/libidav build/tool libidav ucx + cd dav; $(MAKE) all -build: - mkdir -p build +test: build/bin build/lib build/dav build/libidav build/test FORCE dav + cd test; $(MAKE) all + +build/bin: + mkdir -p build/bin -build/tool: - mkdir -p build/tool - +build/lib: + mkdir -p build/lib + +build/dav: + mkdir -p build/dav + +build/libidav: + mkdir -p build/libidav + build/ucx: mkdir -p build/ucx - -build/libidav: - mkdir -p build/libidav build/test: mkdir -p build/test -ucx: FORCE - cd ucx; $(MAKE) CONF=$(CONF) all +build/tool: + mkdir -p build/tool -libidav: FORCE - cd libidav; $(MAKE) CONF=$(CONF) all - -dav: FORCE libidav ucx - cd dav; $(MAKE) CONF=$(CONF) all - -test: FORCE dav - cd test; $(MAKE) CONF=$(CONF) all - -run: FORCE dav - ./build/dav$(APP_EXT) +config.mk: + @echo "create config" + ./configure -clean: FORCE - $(RM) $(RMFLAGS) -R build/ +clean: + @echo "clean" + rm -f -R build -install: FORCE - @echo "install to $(DESTDIR)$(PREFIX)" - ./install-sh -d $(DESTDIR)$(PREFIX)/bin - ./install-sh build/dav $(DESTDIR)$(PREFIX)/bin - ./install-sh build/dav-sync $(DESTDIR)$(PREFIX)/bin +cleanall: + @echo "clean all" + rm -f -R build + rm -f -R work + rm -f config.mk -cppcheck: FORCE build - truncate -s0 $(CPPCHECK_LOG) - cd libidav; $(MAKE) cppcheck - cd dav; $(MAKE) cppcheck - @echo "Static code analysis complete. See $(CPPCHECK_LOG) for the results." +install: all + cd make; $(MAKE) -f install.mk install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) FORCE: