2016-05-12 17:50:50 +02:00
|
|
|
############################################################################
|
|
|
|
# apps/canutils/libcanard/Makefile
|
|
|
|
#
|
|
|
|
# Copyright (C) 2016 Omni Hoverboards Inc. All rights reserved.
|
|
|
|
# Authors: Paul Alexander Patience <paul-a.patience@polymtl.ca>
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
-include $(TOPDIR)/Make.defs
|
|
|
|
include $(APPDIR)/Make.defs
|
|
|
|
|
|
|
|
WGET = wget
|
|
|
|
UNPACK = unzip
|
|
|
|
PACKEXT = .zip
|
|
|
|
|
|
|
|
LIBCANARD_URL = $(patsubst "%",%,$(strip $(CONFIG_LIBCANARD_URL)))
|
|
|
|
LIBCANARD_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBCANARD_VERSION)))
|
|
|
|
LIBCANARD_UNPACKNAME = libcanard-$(LIBCANARD_VERSION)
|
|
|
|
LIBCANARD_PACKNAME = $(LIBCANARD_UNPACKNAME)$(PACKEXT)
|
2016-06-22 14:03:59 +02:00
|
|
|
LIBCANARD_SRCDIR = $(LIBCANARD_UNPACKNAME)
|
|
|
|
LIBCANARD_DRVDIR = $(LIBCANARD_SRCDIR)$(DELIM)drivers$(DELIM)nuttx
|
2016-05-12 17:50:50 +02:00
|
|
|
|
2016-06-22 14:03:59 +02:00
|
|
|
APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)canutils
|
|
|
|
|
2016-07-06 16:02:25 +02:00
|
|
|
CFLAGS += -std=c99 -I$(APPS_INCDIR) -DCANARD_ASSERT=DEBUGASSERT
|
2016-06-22 14:03:59 +02:00
|
|
|
|
2016-07-05 14:52:00 +02:00
|
|
|
CSRCS = $(LIBCANARD_SRCDIR)$(DELIM)canard.c $(LIBCANARD_DRVDIR)$(DELIM)canard_nuttx.c
|
2016-05-12 17:50:50 +02:00
|
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
|
|
|
|
|
|
|
SRCS = $(CSRCS)
|
|
|
|
OBJS = $(COBJS)
|
|
|
|
|
|
|
|
ifeq ($(WINTOOL),y)
|
|
|
|
BIN = "${shell cygpath -w $(APPDIR)$(DELIM)libapps$(LIBEXT)}"
|
|
|
|
else
|
|
|
|
BIN = $(APPDIR)$(DELIM)libapps$(LIBEXT)
|
|
|
|
endif
|
2017-08-13 17:35:14 +02:00
|
|
|
DEPBIN = $(APPDIR)/libapps$(LIBEXT)
|
2016-05-12 17:50:50 +02:00
|
|
|
|
|
|
|
ROOTDEPPATH = --dep-path .
|
|
|
|
|
|
|
|
VPATH =
|
|
|
|
|
|
|
|
all: .built
|
2017-08-13 17:35:14 +02:00
|
|
|
.PHONY: clean depend distclean preconfig
|
2017-08-13 19:03:17 +02:00
|
|
|
.PRECIOUS: ../../libapps$(LIBEXT)
|
2016-05-12 17:50:50 +02:00
|
|
|
|
|
|
|
$(LIBCANARD_PACKNAME):
|
|
|
|
@echo "Downloading: $@"
|
|
|
|
$(Q) $(WGET) -O $@ $(LIBCANARD_URL)$(DELIM)$(LIBCANARD_VERSION)$(PACKEXT)
|
|
|
|
|
|
|
|
$(LIBCANARD_UNPACKNAME): $(LIBCANARD_PACKNAME)
|
|
|
|
@echo "Unpacking: $< -> $@"
|
2016-06-22 14:03:59 +02:00
|
|
|
$(call DELDIR, $@)
|
2016-05-12 17:50:50 +02:00
|
|
|
$(Q) $(UNPACK) $<
|
|
|
|
$(Q) touch $@
|
|
|
|
|
|
|
|
$(LIBCANARD_SRCDIR)$(DELIM)canard.h: $(LIBCANARD_UNPACKNAME)
|
|
|
|
|
2016-06-22 14:03:59 +02:00
|
|
|
$(LIBCANARD_DRVDIR)$(DELIM)canard_nuttx.h: $(LIBCANARD_UNPACKNAME)
|
|
|
|
|
|
|
|
$(APPS_INCDIR)$(DELIM)canard.h: $(LIBCANARD_SRCDIR)$(DELIM)canard.h
|
|
|
|
$(Q) cp $< $@
|
|
|
|
|
|
|
|
$(APPS_INCDIR)$(DELIM)canard_nuttx.h: $(LIBCANARD_DRVDIR)$(DELIM)canard_nuttx.h
|
2016-05-12 17:50:50 +02:00
|
|
|
$(Q) cp $< $@
|
|
|
|
|
|
|
|
$(COBJS): %$(OBJEXT): %.c
|
|
|
|
$(call COMPILE, $<, $@)
|
|
|
|
|
|
|
|
.built: $(OBJS)
|
|
|
|
$(call ARCHIVE, $(BIN), $(OBJS))
|
|
|
|
$(Q) touch $@
|
|
|
|
|
|
|
|
install:
|
|
|
|
|
2016-06-22 14:03:59 +02:00
|
|
|
context: $(APPS_INCDIR)$(DELIM)canard.h $(APPS_INCDIR)$(DELIM)canard_nuttx.h
|
2016-05-12 17:50:50 +02:00
|
|
|
|
|
|
|
.depend: Makefile $(SRCS)
|
|
|
|
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
|
|
|
|
$(Q) touch $@
|
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(call DELFILE, .built)
|
|
|
|
$(call CLEAN)
|
|
|
|
$(foreach OBJ, $(OBJS), $(call DELFILE, $(OBJ)))
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(call DELFILE, Make.dep)
|
|
|
|
$(call DELFILE, .depend)
|
2016-06-22 14:03:59 +02:00
|
|
|
$(call DELFILE, $(APPS_INCDIR)$(DELIM)canard.h)
|
|
|
|
$(call DELFILE, $(APPS_INCDIR)$(DELIM)canard_nuttx.h)
|
2016-05-12 17:50:50 +02:00
|
|
|
$(call DELDIR, $(LIBCANARD_UNPACKNAME))
|
|
|
|
$(call DELFILE, $(LIBCANARD_PACKNAME))
|
|
|
|
|
2016-06-02 16:24:30 +02:00
|
|
|
preconfig:
|
2017-08-13 17:35:14 +02:00
|
|
|
|
|
|
|
-include Make.dep
|