1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- # SPDX-License-Identifier: GPL-2.0 or GPL-3.0
- # Copyright © 2018-2019 Ariadne Devos
- # sHT -- build system -- list of dependencies
- AUTOMAKE_OPTIONS = subdir-objects foreign no-dist \
- -Wobsolete -Woverride -Wunsupported -Werror
- AM_CPPFLAGS = -D_GNU_SOURCE "-I$(srcdir)/arch/$(CONFIG_ARCH)" -Og -g2
- bin_PROGRAMS = shttpd
- shtsources = \
- buffer/append.c \
- buffer/lex.c \
- buffer/memeq.c \
- buffer/skip.c \
- fd/fd.c \
- fd/inet.c \
- generic/bug.c \
- lex/findchar.c \
- lex/ipv4.c \
- lex/nat-decimal.c \
- lex/nat-uphex.c \
- string/filler-merge.c \
- string/setops.c \
- task/accept.c \
- task/perform.c \
- task/sockrw.c \
- task/stream.c \
- worker/alloc.c \
- worker/block-mmap.c \
- worker/edge-epoll.c \
- worker/loop.c \
- worker/objcache.c \
- worker/schedule.c \
- worker/vector.c
- worker/objcache.c: worker/objcache-bless-table.c
- touch -c $@
- worker/objcache-bless-table.c: tools/gen-vector-variants.sh
- $< size sHT_objcache_bless objcache-bless.c > $@T && mv -T $@T $@
- tests/%$(EXEEXT): tests/%.o $(shttpd_OBJECTS) $(shttpd_DEPENDENCIES) $(EXTRA_shttpd_DEPENDENCIES)
- @rm -f shttpd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $< $(shttpd_OBJECTS) $(shttpd_LDADD) $(LIBS)
- tests = \
- tests/append \
- tests/bitvec \
- tests/cmp \
- tests/lex \
- tests/ipv4 \
- tests/memeq \
- tests/index-nospec
- testresult = tests/append
- %.result: %
- ./$< > "$@" 2>&1; \
- cat "$@" || exit 1; \
- if [ "$$?" -eq 0 ]; then \
- rm -f "$@-fail" ; \
- touch "$@-pass" || exit 1; \
- else \
- rm -f "$@-pass" ; \
- touch "$@-fail" || exit 1; \
- fi
- # TODO: fatal error: opening dependency file tests/.deps/append.Tpo
- # Work-around: mkdir tests/.deps
- # Future solution:
- # "don't write a portable Makefile, use a portable (GNU) make instead!"
- # (Mad Scientist's general advice)
- # don't support all platforms (s^2 requires architecture-specific support,
- # and WILL be formally verified for array bounds.
- test: $(foreach t,$(tests),$(t).result)
- @ echo Summary
- @ cat $(foreach t,$(tests),$(t).result)
- @ cat $(foreach t,$(tests),$(t).result-pass) || (echo 'not all tests passed' && exit 1)
- shttpdsources = \
- http/accept.c \
- http/stream.c
- shttpd_SOURCES = $(shtsources) $(shttpdsources)
- # Build the documentation with Sphinx.
- # It is configured in $(srcdir)/doc/conf.py.
- # <http://sphinx-doc.org/stable/>.
- #
- # -n: warn about all missing references
- # -q: only output warning
- # -W: turn warnings into errors
- # -d: cache directory
- # sourcedir, outdir
- html-local:
- sphinx-build -b html -n -q -d $(builddir)/doctrees $(srcdir)/doc $(builddir)/html
- mostlyclean-local:
- -rm -rf $(builddir)/html $(builddir)/doctrees
- # TODO: install the documentation
|