2009-06-17 06:08:59 +08:00
|
|
|
############################################################################
|
2018-08-07 22:30:17 +08:00
|
|
|
# binfmt/Makefile
|
2009-06-17 06:08:59 +08:00
|
|
|
#
|
2024-09-09 15:12:59 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
#
|
2021-02-03 21:47:23 +08: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
|
2009-06-17 06:08:59 +08:00
|
|
|
#
|
2021-02-03 21:47:23 +08:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2009-06-17 06:08:59 +08:00
|
|
|
#
|
2021-02-03 21:47:23 +08: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.
|
2009-06-17 06:08:59 +08:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-19 03:42:11 +08:00
|
|
|
include $(TOPDIR)/Make.defs
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2014-04-14 06:22:22 +08:00
|
|
|
# Basic BINFMT source files
|
2009-06-18 02:45:48 +08:00
|
|
|
|
2021-02-12 13:38:46 +08:00
|
|
|
CSRCS = binfmt_globals.c binfmt_initialize.c binfmt_register.c binfmt_unregister.c
|
|
|
|
CSRCS += binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c
|
2023-11-13 20:59:42 +08:00
|
|
|
CSRCS += binfmt_exec.c binfmt_copyargv.c binfmt_copyactions.c binfmt_dumpmodule.c
|
2012-12-17 05:15:27 +08:00
|
|
|
|
2018-08-05 22:09:54 +08:00
|
|
|
ifeq ($(CONFIG_BINFMT_LOADABLE),y)
|
2021-02-12 13:38:46 +08:00
|
|
|
CSRCS += binfmt_exit.c
|
2013-01-17 22:43:55 +08:00
|
|
|
endif
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2014-09-16 00:15:19 +08:00
|
|
|
ifeq ($(CONFIG_LIBC_EXECFUNCS),y)
|
2021-02-12 13:38:46 +08:00
|
|
|
CSRCS += binfmt_execsymtab.c
|
2014-09-16 00:15:19 +08:00
|
|
|
endif
|
|
|
|
|
2019-08-23 23:07:40 +08:00
|
|
|
# Builtin application interfaces
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_BUILTIN),y)
|
2021-02-12 13:38:46 +08:00
|
|
|
CSRCS += builtin.c
|
2019-08-23 23:07:40 +08:00
|
|
|
endif
|
|
|
|
|
2023-07-09 04:39:31 +08:00
|
|
|
# ELF application interfaces
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ELF),y)
|
|
|
|
CSRCS += elf.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
# NXFLAT application interfaces
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_NXFLAT),y)
|
|
|
|
CSRCS += nxflat.c
|
|
|
|
endif
|
|
|
|
|
2012-10-25 00:46:12 +08:00
|
|
|
# Add configured binary modules
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2020-05-21 01:11:16 +08:00
|
|
|
include libnxflat/Make.defs
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2023-09-19 09:51:50 +08:00
|
|
|
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)sched
|
|
|
|
|
2021-02-12 13:38:46 +08:00
|
|
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
|
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2021-02-12 13:38:46 +08:00
|
|
|
SRCS = $(ASRCS) $(CSRCS)
|
|
|
|
OBJS = $(AOBJS) $(COBJS)
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2012-11-23 05:21:48 +08:00
|
|
|
BIN = libbinfmt$(LIBEXT)
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2012-10-25 00:46:12 +08:00
|
|
|
all: $(BIN)
|
2016-05-11 05:44:06 +08:00
|
|
|
.PHONY: depend clean distclean
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2021-02-12 13:38:46 +08:00
|
|
|
$(AOBJS): %$(OBJEXT): %.S
|
2009-06-17 06:08:59 +08:00
|
|
|
$(call ASSEMBLE, $<, $@)
|
|
|
|
|
2021-02-12 13:38:46 +08:00
|
|
|
$(COBJS): %$(OBJEXT): %.c
|
2009-06-17 06:08:59 +08:00
|
|
|
$(call COMPILE, $<, $@)
|
|
|
|
|
2021-02-12 13:38:46 +08:00
|
|
|
$(BIN): $(OBJS)
|
|
|
|
$(call ARCHIVE, $@, $(OBJS))
|
2020-11-28 11:43:30 +08:00
|
|
|
|
2024-09-15 12:41:42 +08:00
|
|
|
makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
|
|
|
|
$(call CATFILE, Make.dep, $^)
|
|
|
|
$(call DELFILE, $^)
|
|
|
|
|
2021-02-12 13:38:46 +08:00
|
|
|
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
|
2024-09-15 12:41:42 +08:00
|
|
|
$(Q) $(MAKE) makedepfile
|
2020-03-23 10:44:03 +08:00
|
|
|
$(Q) touch $@
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2020-03-23 10:44:03 +08:00
|
|
|
depend: .depend
|
2009-06-17 06:08:59 +08:00
|
|
|
|
|
|
|
clean:
|
2012-11-20 23:47:41 +08:00
|
|
|
$(call DELFILE, $(BIN))
|
2009-06-17 06:08:59 +08:00
|
|
|
$(call CLEAN)
|
|
|
|
|
|
|
|
distclean: clean
|
2012-11-20 23:47:41 +08:00
|
|
|
$(call DELFILE, Make.dep)
|
2020-03-23 10:44:03 +08:00
|
|
|
$(call DELFILE, .depend)
|
2009-06-17 06:08:59 +08:00
|
|
|
|
|
|
|
-include Make.dep
|