source: azure_iot_hub_f767zi/trunk/asp_baseplatform/lwip/contrib-2.1.0/ports/Common.allports.mk@ 457

Last change on this file since 457 was 457, checked in by coas-nagasima, 4 years ago

ファイルを追加

File size: 3.6 KB
Line 
1#
2# Copyright (c) 2001, 2002 Swedish Institute of Computer Science.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without modification,
6# are permitted provided that the following conditions are met:
7#
8# 1. Redistributions of source code must retain the above copyright notice,
9# this list of conditions and the following disclaimer.
10# 2. Redistributions in binary form must reproduce the above copyright notice,
11# this list of conditions and the following disclaimer in the documentation
12# and/or other materials provided with the distribution.
13# 3. The name of the author may not be used to endorse or promote products
14# derived from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
19# SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
21# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
25# OF SUCH DAMAGE.
26#
27# This file is part of the lwIP TCP/IP stack.
28#
29# Author: Adam Dunkels <adam@sics.se>
30#
31
32#CC=gcc
33#CC=clang
34CCDEP?=$(CC)
35
36CFLAGS+=-g -DLWIP_DEBUG -Wall -pedantic -Werror \
37 -Wparentheses -Wsequence-point -Wswitch-default \
38 -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual \
39 -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align \
40 -Wmissing-prototypes -Wredundant-decls -Wnested-externs \
41 -Wunreachable-code -Wuninitialized -Wmissing-prototypes \
42 -Wredundant-decls -Waggregate-return -Wlogical-not-parentheses
43# -Wconversion -Wsign-compare -Wmissing-include-dirs
44
45ifeq (,$(findstring clang,$(CC)))
46CFLAGS+= -Wlogical-op -Wc90-c99-compat -Wtrampolines
47# if GCC is newer than 4.8/4.9 you may use:
48#CFLAGS:=$(CFLAGS) -fsanitize=address -fstack-protector -fstack-check -fsanitize=undefined -fno-sanitize=alignment
49else
50# we cannot sanitize alignment on x86-64 targets because clang wants 64 bit alignment
51CFLAGS+= -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -Wdocumentation -Wno-documentation-deprecated-sync
52endif
53
54CONTRIBDIR?=../../..
55ARFLAGS?=rs
56
57#Set this to where you have the lwip core module checked out from git
58#default assumes it's a dir named lwip at the same level as the contrib module
59LWIPDIR?=$(CONTRIBDIR)/../lwip/src
60
61CFLAGS+=-I. \
62 -I$(CONTRIBDIR) \
63 -I$(LWIPDIR)/include \
64 -I$(LWIPARCH)/include
65
66# Add include path and link to mbedTLS lib if available
67MBEDTLSDIR?=$(CONTRIBDIR)/../mbedtls
68ifneq (,$(wildcard $(MBEDTLSDIR)/include/mbedtls/*.h))
69LDFLAGS+=-L$(MBEDTLSDIR)/library -lmbedtls -lmbedcrypto -lmbedx509
70CFLAGS+=-I$(MBEDTLSDIR)/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -Wno-c90-c99-compat
71endif
72
73include $(CONTRIBDIR)/Filelists.mk
74include $(LWIPDIR)/Filelists.mk
75
76# LWIPFILES: All the above.
77LWIPFILES=$(LWIPNOAPPSFILES) $(ARCHFILES)
78LWIPOBJS=$(notdir $(LWIPFILES:.c=.o))
79
80LWIPLIBCOMMON=liblwipcommon.a
81$(LWIPLIBCOMMON): $(LWIPOBJS)
82 $(AR) $(ARFLAGS) $(LWIPLIBCOMMON) $?
83
84APPFILES=$(CONTRIBAPPFILES) $(LWIPAPPFILES)
85APPLIB=liblwipapps.a
86APPOBJS=$(notdir $(APPFILES:.c=.o))
87$(APPLIB): $(APPOBJS)
88 $(AR) $(ARFLAGS) $(APPLIB) $?
89
90%.o:
91 $(CC) $(CFLAGS) -c $<
Note: See TracBrowser for help on using the repository browser.