2012-10-25 22:06:46 +02:00
|
|
|
############################################################################
|
|
|
|
# examples/elf/tests/pthread/Makefile
|
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership. The
|
|
|
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance with the
|
|
|
|
# License. You may obtain a copy of the License at
|
2012-10-25 22:06:46 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2012-10-25 22:06:46 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
# License for the specific language governing permissions and limitations
|
|
|
|
# under the License.
|
2012-10-25 22:06:46 +02:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-20 06:35:03 +02:00
|
|
|
include $(APPDIR)/Make.defs
|
2014-08-29 15:20:07 +02:00
|
|
|
|
|
|
|
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-09-05 21:59:20 +02:00
|
|
|
LDLIBS += -lc
|
2014-08-29 15:20:07 +02:00
|
|
|
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-25 22:06:46 +02:00
|
|
|
BIN = pthread
|
|
|
|
|
|
|
|
SRCS = $(BIN).c
|
2014-09-06 00:05:29 +02:00
|
|
|
OBJS = $(SRCS:.c=$(OBJEXT))
|
2012-10-25 22:06:46 +02:00
|
|
|
|
|
|
|
all: $(BIN)
|
2020-03-23 18:40:44 +01:00
|
|
|
.PHONY: all 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
|
|
|
|
2020-03-16 10:12:16 +01:00
|
|
|
$(FSIMG_DIR)/$(BIN): $(BIN)
|
|
|
|
$(Q) mkdir -p $(FSIMG_DIR)
|
|
|
|
$(Q) install $(BIN) $(FSIMG_DIR)/$(BIN)
|
2020-03-23 18:40:44 +01:00
|
|
|
ifneq ($(CONFIG_DEBUG_SYMBOLS),y)
|
|
|
|
$(Q) $(STRIP) $(FSIMG_DIR)/$(BIN)
|
|
|
|
endif
|
2020-03-16 10:12:16 +01:00
|
|
|
|
|
|
|
install: $(FSIMG_DIR)/$(BIN)
|
|
|
|
|
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)
|