1c87c5fbaSopenharmony_ci# -*- Mode: Makefile for CI checks -*-
2c87c5fbaSopenharmony_ci#
3c87c5fbaSopenharmony_ci# Copyright (C) 2019--2023 Olaf Bergmann <bergmann@tzi.org> and others
4c87c5fbaSopenharmony_ci#
5c87c5fbaSopenharmony_ci# SPDX-License-Identifier: BSD-2-Clause
6c87c5fbaSopenharmony_ci#
7c87c5fbaSopenharmony_ci# This file is part of the CoAP library libcoap. Please see README for terms
8c87c5fbaSopenharmony_ci# of use.
9c87c5fbaSopenharmony_ci
10c87c5fbaSopenharmony_citop_builddir?=@top_builddir@
11c87c5fbaSopenharmony_citop_srcdir?=@top_srcdir@
12c87c5fbaSopenharmony_ciOUT?=.
13c87c5fbaSopenharmony_cilibcoap?=libcoap-@LIBCOAP_NAME_SUFFIX@
14c87c5fbaSopenharmony_ciWARNING_CFLAGS?=@WARNING_CFLAGS@
15c87c5fbaSopenharmony_ciDTLS_CFLAGS?=@DTLS_CFLAGS@
16c87c5fbaSopenharmony_ciDTLS_LIBS?=@DTLS_LIBS@
17c87c5fbaSopenharmony_ciCPPFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include
18c87c5fbaSopenharmony_ciCFLAGS=$(WARNING_CFLAGS) $(DTLS_CFLAGS) -std=c99
19c87c5fbaSopenharmony_ciCFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
20c87c5fbaSopenharmony_ci
21c87c5fbaSopenharmony_ciSOURCES:=$(wildcard *_target.c)
22c87c5fbaSopenharmony_ciOBJECTS:= $(patsubst %.c, $(OUT)/%.o, $(SOURCES))
23c87c5fbaSopenharmony_ciPROGRAMS:=$(patsubst %_target.o, %_fuzzer, $(OBJECTS))
24c87c5fbaSopenharmony_ci
25c87c5fbaSopenharmony_ci.PHONY: all check
26c87c5fbaSopenharmony_ci
27c87c5fbaSopenharmony_ciall: $(PROGRAMS)
28c87c5fbaSopenharmony_ci
29c87c5fbaSopenharmony_ci$(OUT)/%.o: %.c
30c87c5fbaSopenharmony_ci	$(CC) $(CPPFLAGS) $(CFLAGS) -c $^ -o $@
31c87c5fbaSopenharmony_ci
32c87c5fbaSopenharmony_ci%_fuzzer: %_target.o
33c87c5fbaSopenharmony_ci	$(LINK.cc) $(CXXFLAGS) $^ $(top_builddir)/.libs/$(libcoap).a $(LDFLAGS) $(LDLIBS) $(DTLS_LIBS) -o $@
34c87c5fbaSopenharmony_ci
35c87c5fbaSopenharmony_cicheck: $(OBJECTS)
36c87c5fbaSopenharmony_ci
37c87c5fbaSopenharmony_ciclean:
38c87c5fbaSopenharmony_ci	@-$(RM) $(OBJECTS) $(PROGRAMS)
39