2009-06-17 00:08:59 +02:00
|
|
|
############################################################################
|
2018-08-07 16:30:17 +02:00
|
|
|
# binfmt/Makefile
|
2009-06-17 00:08:59 +02:00
|
|
|
#
|
2021-02-03 14:47:23 +01: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 00:08:59 +02:00
|
|
|
#
|
2021-02-03 14:47:23 +01:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2009-06-17 00:08:59 +02:00
|
|
|
#
|
2021-02-03 14:47:23 +01: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 00:08:59 +02:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-18 21:42:11 +02:00
|
|
|
include $(TOPDIR)/Make.defs
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2014-04-14 00:22:22 +02:00
|
|
|
# Basic BINFMT source files
|
2009-06-17 20:45:48 +02:00
|
|
|
|
2018-08-23 17:09:39 +02:00
|
|
|
BINFMT_CSRCS = binfmt_globals.c binfmt_initialize.c binfmt_register.c binfmt_unregister.c
|
2012-12-16 22:15:27 +01:00
|
|
|
BINFMT_CSRCS += binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c
|
2015-11-14 14:29:47 +01:00
|
|
|
BINFMT_CSRCS += binfmt_exec.c binfmt_copyargv.c binfmt_dumpmodule.c
|
2012-12-16 22:15:27 +01:00
|
|
|
|
2018-08-05 16:09:54 +02:00
|
|
|
ifeq ($(CONFIG_BINFMT_LOADABLE),y)
|
|
|
|
BINFMT_CSRCS += binfmt_exit.c
|
2013-01-17 15:43:55 +01:00
|
|
|
endif
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2014-09-15 18:15:19 +02:00
|
|
|
ifeq ($(CONFIG_LIBC_EXECFUNCS),y)
|
|
|
|
BINFMT_CSRCS += binfmt_execsymtab.c
|
|
|
|
endif
|
|
|
|
|
2019-08-23 17:07:40 +02:00
|
|
|
# Builtin application interfaces
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_BUILTIN),y)
|
2019-08-25 16:58:30 +02:00
|
|
|
BINFMT_CSRCS += builtin.c
|
2019-08-23 17:07:40 +02:00
|
|
|
endif
|
|
|
|
|
2012-10-24 18:46:12 +02:00
|
|
|
# Add configured binary modules
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2020-05-20 19:11:16 +02:00
|
|
|
include libnxflat/Make.defs
|
|
|
|
include libelf/Make.defs
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2012-11-22 22:21:48 +01:00
|
|
|
BINFMT_AOBJS = $(BINFMT_ASRCS:.S=$(OBJEXT))
|
|
|
|
BINFMT_COBJS = $(BINFMT_CSRCS:.c=$(OBJEXT))
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2012-11-22 22:21:48 +01:00
|
|
|
BINFMT_SRCS = $(BINFMT_ASRCS) $(BINFMT_CSRCS)
|
|
|
|
BINFMT_OBJS = $(BINFMT_AOBJS) $(BINFMT_COBJS)
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2012-11-22 22:21:48 +01:00
|
|
|
BIN = libbinfmt$(LIBEXT)
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2012-10-24 18:46:12 +02:00
|
|
|
all: $(BIN)
|
2016-05-10 23:44:06 +02:00
|
|
|
.PHONY: depend clean distclean
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2012-10-24 18:46:12 +02:00
|
|
|
$(BINFMT_AOBJS): %$(OBJEXT): %.S
|
2009-06-17 00:08:59 +02:00
|
|
|
$(call ASSEMBLE, $<, $@)
|
|
|
|
|
2012-10-24 18:46:12 +02:00
|
|
|
$(BINFMT_COBJS): %$(OBJEXT): %.c
|
2009-06-17 00:08:59 +02:00
|
|
|
$(call COMPILE, $<, $@)
|
|
|
|
|
2012-10-24 18:46:12 +02:00
|
|
|
$(BIN): $(BINFMT_OBJS)
|
2012-11-15 18:43:29 +01:00
|
|
|
$(call ARCHIVE, $@, $(BINFMT_OBJS))
|
2020-11-28 04:43:30 +01:00
|
|
|
|
2020-11-18 17:44:58 +01:00
|
|
|
makedepfile: $(BINFMT_CSRCS:.c=.ddc) $(BINFMT_ASRCS:.S=.dds)
|
|
|
|
$(call CATFILE, Make.dep, $^)
|
|
|
|
$(call DELFILE, $^)
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2020-07-22 09:54:29 +02:00
|
|
|
.depend: Makefile $(BINFMT_SRCS) $(TOPDIR)$(DELIM).config
|
2020-11-18 17:44:58 +01:00
|
|
|
$(Q) $(MAKE) makedepfile
|
2020-03-23 03:44:03 +01:00
|
|
|
$(Q) touch $@
|
2009-06-17 00:08:59 +02:00
|
|
|
|
2020-03-23 03:44:03 +01:00
|
|
|
depend: .depend
|
2009-06-17 00:08:59 +02:00
|
|
|
|
|
|
|
clean:
|
2012-11-20 16:47:41 +01:00
|
|
|
$(call DELFILE, $(BIN))
|
2009-06-17 00:08:59 +02:00
|
|
|
$(call CLEAN)
|
|
|
|
|
|
|
|
distclean: clean
|
2012-11-20 16:47:41 +01:00
|
|
|
$(call DELFILE, Make.dep)
|
2020-03-23 03:44:03 +01:00
|
|
|
$(call DELFILE, .depend)
|
2009-06-17 00:08:59 +02:00
|
|
|
|
|
|
|
-include Make.dep
|