mirror of
https://github.com/openharmony/third_party_libcoap.git
synced 2026-07-01 22:44:03 -04:00
6e406d242a
Signed-off-by: ye-xiaokang123 <yexiaokang3@huawei.com>
45 lines
1.1 KiB
Makefile
45 lines
1.1 KiB
Makefile
# Makefile for libcoap standalone examples
|
|
#
|
|
# Copyright (C) 2021-2024 Olaf Bergmann <bergmann@tzi.org>
|
|
#
|
|
# This file is part of the CoAP C library libcoap. Please see README and
|
|
# COPYING for terms of use.
|
|
|
|
# Set external variable LIBCOAP if you need a specific libcoap library.
|
|
# E.g. libcoap-3-openssl, libcoap-3-gnutls, libcoap-3-mbedtls, libcoap-3-wolfssl
|
|
# or libcoap-3-notls
|
|
#
|
|
LIBCOAP?=libcoap-3
|
|
|
|
WARNING_CFLAGS= \
|
|
-pedantic \
|
|
-Wall \
|
|
-Wcast-qual \
|
|
-Wextra \
|
|
-Wformat-security \
|
|
-Winline \
|
|
-Wmissing-declarations \
|
|
-Wmissing-prototypes \
|
|
-Wnested-externs \
|
|
-Wpointer-arith \
|
|
-Wshadow \
|
|
-Wstrict-prototypes \
|
|
-Wswitch-default \
|
|
-Wswitch-enum \
|
|
-Wunused \
|
|
-Wwrite-strings
|
|
|
|
pkgconfig=$(shell pkg-config $(1) $(2))
|
|
|
|
CPPFLAGS=-D_GNU_SOURCE $(WARNING_CFLAGS) $(call pkgconfig,--cflags,$(LIBCOAP))
|
|
CFLAGS=-std=c99
|
|
LDLIBS=$(call pkgconfig,--libs-only-l,$(LIBCOAP))
|
|
libdirs=$(call pkgconfig,--libs-only-L,$(LIBCOAP))
|
|
rpath=$(shell echo "$(libdirs)" | sed -e 's/^-L/-Wl,--rpath /')
|
|
LDFLAGS=$(libdirs) $(rpath)
|
|
|
|
all: coap-client coap-server
|
|
|
|
clean:
|
|
rm -f *.o coap-client coap-server
|