]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/icmp/Makefile.am
Source Format Enforcement (#665)
[thirdparty/squid.git] / src / icmp / Makefile.am
index 4be96995217a4a511002ff9d256ca09bf6dfe325..3db8488b4da7124134d5d9480e7f9640d4467726 100644 (file)
@@ -1,81 +1,73 @@
+## Copyright (C) 1996-2020 The Squid Software Foundation and contributors
+##
+## Squid software is distributed under GPLv2+ license and includes
+## contributions from numerous individuals and organizations.
+## Please see the COPYING and CONTRIBUTORS files for details.
+##
+
 include $(top_srcdir)/src/Common.am
 include $(top_srcdir)/src/TestHeaders.am
 
-# TODO: get rid of this when config filename is no longer a global constant.
-#      its only here so the testIcmp will link .
-DEFS += -DDEFAULT_CONFIG_FILE=NULL
-
-
 # ICMP Specific Configurations
 
 if ENABLE_PINGER
-PINGER = pinger
+libexec_PROGRAMS = pinger
 else
-PINGER =
+EXTRA_PROGRAMS = pinger
 endif
 
-EXTRA_PROGRAMS = \
-       pinger \
-       testIcmp
-
-libexec_PROGRAMS = $(PINGER)
-
-noinst_LTLIBRARIES = libicmp-core.la libicmp.la
-
-SBUF_SOURCE= \
-       $(top_srcdir)/src/SBuf.h \
-       $(top_srcdir)/src/SBuf.cc \
-       $(top_srcdir)/src/MemBlob.h \
-       $(top_srcdir)/src/MemBlob.cc \
-       $(top_srcdir)/src/OutOfBoundsException.h \
-       $(top_srcdir)/src/SBufExceptions.h \
-       $(top_srcdir)/src/SBufExceptions.cc \
-       $(top_srcdir)/src/String.cc \
-       $(top_srcdir)/src/SquidString.h \
-       $(top_srcdir)/src/base/TextException.h \
-       $(top_srcdir)/src/base/TextException.cc
+noinst_LTLIBRARIES = libicmpcore.la libicmp.la
 
 # ICMP API definition ...
-libicmp_core_la_SOURCES = \
-       Icmp.h \
-       Icmp.cc
+libicmpcore_la_SOURCES = \
+       Icmp.cc \
+       Icmp.h
 
 # Squid Internal ICMP helper interface
 libicmp_la_SOURCES = \
+       IcmpConfig.cc \
        IcmpConfig.h \
-       IcmpSquid.h \
        IcmpSquid.cc \
-       net_db.h \
-       net_db.cc
+       IcmpSquid.h \
+       net_db.cc \
+       net_db.h
+
+libicmp_la_LIBADD= libicmpcore.la
+
+# pinger depends on these but install/dist is done elsewhere.
+COPIED_SOURCE= \
+       debug.cc \
+       globals.cc \
+       SquidConfig.cc \
+       SquidNew.cc \
+       stub_fd.cc \
+       stub_HelperChildConfig.cc \
+       stub_libmem.cc \
+       stub_SBuf.cc \
+       STUB.h \
+       time.cc
 
 # ICMP lookup helper
 pinger_SOURCES = \
        Icmp.h \
-       IcmpPinger.h \
-       IcmpPinger.cc \
-       Icmp4.h \
        Icmp4.cc \
-       Icmp6.h \
+       Icmp4.h \
        Icmp6.cc \
+       Icmp6.h \
+       IcmpPinger.cc \
+       IcmpPinger.h \
        pinger.cc
-
-# depends on these but install/dist is done elsewhere.
-# TODO: remove when these are cleaned up in their own way.
-nodist_pinger_SOURCES = \
-       $(top_srcdir)/src/debug.cc \
-       $(top_builddir)/src/globals.cc \
-       $(top_srcdir)/src/time.cc \
-       $(top_srcdir)/src/SquidConfig.cc \
-       $(top_srcdir)/src/SquidNew.cc \
-       $(top_srcdir)/src/tests/stub_HelperChildConfig.cc
-
+nodist_pinger_SOURCES = $(COPIED_SOURCE)
 pinger_LDFLAGS = $(LIBADD_DL)
 pinger_LDADD=\
-       libicmp-core.la \
-       ../ip/libip.la \
+       libicmpcore.la \
+       $(top_builddir)/src/ip/libip.la \
+       $(top_builddir)/src/base/libbase.la \
        $(COMPAT_LIB) \
+       $(SSLLIB) \
        $(XTRA_LIBS)
 
+CLEANFILES += $(COPIED_SOURCE)
 
 ##install-pinger:
 ##     @f=$(PINGER_EXE); \
@@ -90,29 +82,34 @@ pinger_LDADD=\
 ##             $(RM) -f $(libexecdir)/-$$f; \
 ##     fi
 
+## files we need to pull in from other locations
+## copied like this to avoid subdir-objects collisions on 'make clean'
+debug.cc: $(top_srcdir)/src/debug.cc
+       cp $(top_srcdir)/src/debug.cc $@
 
-check_PROGRAMS += testIcmp
-TESTS += testIcmp
+globals.cc: $(top_srcdir)/src/globals.h
+       cp $(top_builddir)/src/globals.cc $@
 
-## Tests of the ICMP base module.
-# Its used by pinger so SHOULD NOT require more dependancies! :-(
-testIcmp_SOURCES = \
-       Icmp.h \
-       testIcmp.h \
-       testIcmp.cc
-nodist_testIcmp_SOURCES = \
-       $(top_srcdir)/src/tests/testMain.cc \
-       $(top_srcdir)/src/SquidTime.h \
-       $(top_srcdir)/src/tests/stub_debug.cc \
-       $(top_srcdir)/src/time.cc \
-       $(top_srcdir)/test-suite/test_tools.cc \
-       $(top_builddir)/src/globals.cc
-testIcmp_LDFLAGS = $(LIBADD_DL)
-testIcmp_LDADD=\
-       $(SQUID_CPPUNIT_LIBS) \
-       $(SQUID_CPPUNIT_LA) \
-       libicmp-core.la \
-       ../ip/libip.la \
-       $(COMPAT_LIB) \
-       $(XTRA_LIBS)
-testIcmp_DEPENDENCIES= $(SQUID_CPPUNIT_LA)
+time.cc: $(top_srcdir)/src/time.cc
+       cp $(top_srcdir)/src/time.cc $@
+
+SquidConfig.cc: $(top_srcdir)/src/SquidConfig.cc
+       cp $(top_srcdir)/src/SquidConfig.cc $@
+
+SquidNew.cc: $(top_srcdir)/src/SquidNew.cc
+       cp $(top_srcdir)/src/SquidNew.cc $@
+
+stub_HelperChildConfig.cc: $(top_srcdir)/src/tests/stub_HelperChildConfig.cc
+       cp $(top_srcdir)/src/tests/stub_HelperChildConfig.cc $@
+
+stub_fd.cc: $(top_srcdir)/src/tests/stub_fd.cc STUB.h
+       cp $(top_srcdir)/src/tests/stub_fd.cc $@
+
+stub_libmem.cc: $(top_srcdir)/src/tests/stub_libmem.cc STUB.h
+       cp $(top_srcdir)/src/tests/stub_libmem.cc $@
+
+stub_SBuf.cc: $(top_srcdir)/src/tests/stub_SBuf.cc STUB.h
+       cp $(top_srcdir)/src/tests/stub_SBuf.cc $@
+
+STUB.h: $(top_srcdir)/src/tests/STUB.h
+       cp $(top_srcdir)/src/tests/STUB.h $@