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
|
|
|
#
|
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
|
|
|
|
2018-08-23 23:09:39 +08:00
|
|
|
BINFMT_CSRCS = binfmt_globals.c binfmt_initialize.c binfmt_register.c binfmt_unregister.c
|
2012-12-17 05:15:27 +08:00
|
|
|
BINFMT_CSRCS += binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c
|
2015-11-14 21:29:47 +08:00
|
|
|
BINFMT_CSRCS += binfmt_exec.c binfmt_copyargv.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)
|
|
|
|
BINFMT_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)
|
|
|
|
BINFMT_CSRCS += binfmt_execsymtab.c
|
|
|
|
endif
|
|
|
|
|
2019-08-23 23:07:40 +08:00
|
|
|
# Builtin application interfaces
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_BUILTIN),y)
|
2019-08-25 22:58:30 +08:00
|
|
|
BINFMT_CSRCS += builtin.c
|
2019-08-23 23:07:40 +08:00
|
|
|
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
|
|
|
|
include libelf/Make.defs
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2012-11-23 05:21:48 +08:00
|
|
|
BINFMT_AOBJS = $(BINFMT_ASRCS:.S=$(OBJEXT))
|
|
|
|
BINFMT_COBJS = $(BINFMT_CSRCS:.c=$(OBJEXT))
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2012-11-23 05:21:48 +08:00
|
|
|
BINFMT_SRCS = $(BINFMT_ASRCS) $(BINFMT_CSRCS)
|
|
|
|
BINFMT_OBJS = $(BINFMT_AOBJS) $(BINFMT_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
|
|
|
|
2012-10-25 00:46:12 +08:00
|
|
|
$(BINFMT_AOBJS): %$(OBJEXT): %.S
|
2009-06-17 06:08:59 +08:00
|
|
|
$(call ASSEMBLE, $<, $@)
|
|
|
|
|
2012-10-25 00:46:12 +08:00
|
|
|
$(BINFMT_COBJS): %$(OBJEXT): %.c
|
2009-06-17 06:08:59 +08:00
|
|
|
$(call COMPILE, $<, $@)
|
|
|
|
|
2012-10-25 00:46:12 +08:00
|
|
|
$(BIN): $(BINFMT_OBJS)
|
2012-11-16 01:43:29 +08:00
|
|
|
$(call ARCHIVE, $@, $(BINFMT_OBJS))
|
2020-11-28 11:43:30 +08:00
|
|
|
|
2020-11-19 00:44:58 +08:00
|
|
|
makedepfile: $(BINFMT_CSRCS:.c=.ddc) $(BINFMT_ASRCS:.S=.dds)
|
|
|
|
$(call CATFILE, Make.dep, $^)
|
|
|
|
$(call DELFILE, $^)
|
2009-06-17 06:08:59 +08:00
|
|
|
|
2020-07-22 15:54:29 +08:00
|
|
|
.depend: Makefile $(BINFMT_SRCS) $(TOPDIR)$(DELIM).config
|
2020-11-19 00:44:58 +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
|