2012-10-25 22:06:46 +02:00
|
|
|
############################################################################
|
2014-08-29 15:20:07 +02:00
|
|
|
# examples/elf/tests/struct/Makefile
|
2012-10-25 22:06:46 +02:00
|
|
|
#
|
2016-05-10 23:40:20 +02:00
|
|
|
# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
|
2012-10-25 22:06:46 +02:00
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2019-10-04 16:35:46 +02:00
|
|
|
include $(TOPDIR)/Make.defs
|
2012-10-25 22:06:46 +02:00
|
|
|
|
2016-05-10 23:40:20 +02:00
|
|
|
OBJEXT ?= .o
|
|
|
|
DELIM ?= /
|
|
|
|
|
2012-10-27 02:04:47 +02:00
|
|
|
CELFFLAGS += -I.
|
2012-10-25 22:06:46 +02:00
|
|
|
|
2014-08-29 15:20:07 +02:00
|
|
|
ifeq ($(WINTOOL),y)
|
2018-05-30 19:08:13 +02:00
|
|
|
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
|
2014-08-29 15:20:07 +02:00
|
|
|
else
|
2018-05-30 19:08:13 +02:00
|
|
|
NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
|
2014-08-29 15:20:07 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
|
|
|
|
LDELFFLAGS += -Bstatic
|
2014-09-05 21:59:20 +02:00
|
|
|
LDLIBPATH += -L $(NUTTXLIB)
|
2014-08-29 15:20:07 +02:00
|
|
|
else
|
|
|
|
ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y)
|
|
|
|
LDELFFLAGS += -Bstatic
|
2014-09-05 21:59:20 +02:00
|
|
|
LDLIBPATH += -L $(NUTTXLIB)
|
2014-08-29 15:20:07 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y)
|
2014-08-29 22:47:22 +02:00
|
|
|
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
2014-09-05 21:59:20 +02:00
|
|
|
LDLIBS += -luc
|
2014-08-29 15:20:07 +02:00
|
|
|
else
|
2014-09-05 21:59:20 +02:00
|
|
|
LDLIBS += -lc
|
2014-08-29 15:20:07 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
|
2014-09-05 21:59:20 +02:00
|
|
|
LDLIBS += -lproxies
|
2014-08-29 15:20:07 +02:00
|
|
|
endif
|
|
|
|
|
2012-10-26 00:10:56 +02:00
|
|
|
BIN = struct
|
2012-10-25 22:06:46 +02:00
|
|
|
SRCS = struct_main.c struct_dummy.c
|
2014-09-06 00:05:29 +02:00
|
|
|
OBJS = $(SRCS:.c=$(OBJEXT))
|
2012-10-25 22:06:46 +02:00
|
|
|
|
|
|
|
all: $(BIN)
|
2016-05-10 23:40:20 +02:00
|
|
|
.PHONY: clean install
|
2012-10-25 22:06:46 +02:00
|
|
|
|
2014-09-06 00:05:29 +02:00
|
|
|
$(OBJS): %$(OBJEXT): %.c
|
2012-10-25 22:06:46 +02:00
|
|
|
@echo "CC: $<"
|
2012-11-17 19:54:53 +01:00
|
|
|
$(Q) $(CC) -c $(CELFFLAGS) $< -o $@
|
2012-10-25 22:06:46 +02:00
|
|
|
|
|
|
|
$(BIN): $(OBJS)
|
|
|
|
@echo "LD: $<"
|
2014-09-06 00:05:29 +02:00
|
|
|
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS)
|
2012-10-25 22:06:46 +02:00
|
|
|
|
2014-04-14 00:24:28 +02:00
|
|
|
clean:
|
2012-11-20 16:47:41 +01:00
|
|
|
$(call DELFILE, $(BIN))
|
2012-11-17 19:54:53 +01:00
|
|
|
$(call CLEAN)
|
2012-10-25 22:06:46 +02:00
|
|
|
|
|
|
|
install:
|
2018-03-24 18:36:20 +01:00
|
|
|
$(Q) mkdir -p $(FSIMG_DIR)
|
|
|
|
$(Q) install $(BIN) $(FSIMG_DIR)/$(BIN)
|