1c87c5fbaSopenharmony_ci# Makefile for libcoap standalone examples
2c87c5fbaSopenharmony_ci#
3c87c5fbaSopenharmony_ci# Copyright (C) 2021-2023 Olaf Bergmann <bergmann@tzi.org>
4c87c5fbaSopenharmony_ci#
5c87c5fbaSopenharmony_ci# This file is part of the CoAP C library libcoap. Please see README and
6c87c5fbaSopenharmony_ci# COPYING for terms of use.
7c87c5fbaSopenharmony_ci
8c87c5fbaSopenharmony_ci# Set external variable LIBCOAP if you need a specific libcoap library.
9c87c5fbaSopenharmony_ci# E.g. libcoap-3-openssl, libcoap-3-gnutls, libcoap-3-mbedtls or libcoap-3-notls
10c87c5fbaSopenharmony_ci#
11c87c5fbaSopenharmony_ciLIBCOAP?=libcoap-3
12c87c5fbaSopenharmony_ci
13c87c5fbaSopenharmony_ciWARNING_CFLAGS= \
14c87c5fbaSopenharmony_ci	-pedantic \
15c87c5fbaSopenharmony_ci	-Wall \
16c87c5fbaSopenharmony_ci	-Wcast-qual \
17c87c5fbaSopenharmony_ci	-Wextra \
18c87c5fbaSopenharmony_ci	-Wformat-security \
19c87c5fbaSopenharmony_ci	-Winline \
20c87c5fbaSopenharmony_ci	-Wmissing-declarations \
21c87c5fbaSopenharmony_ci	-Wmissing-prototypes \
22c87c5fbaSopenharmony_ci	-Wnested-externs \
23c87c5fbaSopenharmony_ci	-Wpointer-arith \
24c87c5fbaSopenharmony_ci	-Wshadow \
25c87c5fbaSopenharmony_ci	-Wstrict-prototypes \
26c87c5fbaSopenharmony_ci	-Wswitch-default \
27c87c5fbaSopenharmony_ci	-Wswitch-enum \
28c87c5fbaSopenharmony_ci	-Wunused \
29c87c5fbaSopenharmony_ci	-Wwrite-strings
30c87c5fbaSopenharmony_ci
31c87c5fbaSopenharmony_cipkgconfig=$(shell pkg-config $(1) $(2))
32c87c5fbaSopenharmony_ci
33c87c5fbaSopenharmony_ciCPPFLAGS=-D_GNU_SOURCE $(WARNING_CFLAGS) $(call pkgconfig,--cflags,$(LIBCOAP))
34c87c5fbaSopenharmony_ciCFLAGS=-std=c99
35c87c5fbaSopenharmony_ciLDLIBS=$(call pkgconfig,--libs-only-l,$(LIBCOAP))
36c87c5fbaSopenharmony_cilibdirs=$(call pkgconfig,--libs-only-L,$(LIBCOAP))
37c87c5fbaSopenharmony_cirpath=$(shell echo "$(libdirs)" | sed -e 's/^-L/-Wl,--rpath /')
38c87c5fbaSopenharmony_ciLDFLAGS=$(libdirs) $(rpath)
39c87c5fbaSopenharmony_ci
40c87c5fbaSopenharmony_ciall: coap-client coap-server
41c87c5fbaSopenharmony_ci
42c87c5fbaSopenharmony_ciclean:
43c87c5fbaSopenharmony_ci	rm -f *.o coap-client coap-server
44