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