2008-01-08 01:19:24 +01:00
|
|
|
############################################################################
|
|
|
|
# mm/Makefile
|
2007-02-18 00:21:28 +01:00
|
|
|
#
|
2021-02-08 13:50:10 +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
|
2007-02-18 00:21:28 +01:00
|
|
|
#
|
2021-02-08 13:50:10 +01:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2007-02-18 00:21:28 +01:00
|
|
|
#
|
2021-02-08 13:50:10 +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.
|
2007-02-18 00:21:28 +01:00
|
|
|
#
|
2008-01-08 01:19:24 +01:00
|
|
|
############################################################################
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2020-05-18 21:42:11 +02:00
|
|
|
include $(TOPDIR)/Make.defs
|
2014-02-07 17:14:11 +01:00
|
|
|
|
2014-09-22 18:33:23 +02:00
|
|
|
# Sources and paths
|
2013-03-09 22:12:20 +01:00
|
|
|
|
2014-09-22 18:53:50 +02:00
|
|
|
include mm_heap/Make.defs
|
2014-09-22 18:48:58 +02:00
|
|
|
include umm_heap/Make.defs
|
2014-09-22 18:42:26 +02:00
|
|
|
include kmm_heap/Make.defs
|
2014-09-22 18:33:23 +02:00
|
|
|
include mm_gran/Make.defs
|
2014-09-22 18:58:27 +02:00
|
|
|
include shm/Make.defs
|
2017-05-09 15:34:59 +02:00
|
|
|
include iob/Make.defs
|
2020-11-12 11:40:06 +01:00
|
|
|
include circbuf/Make.defs
|
2022-07-20 15:37:26 +02:00
|
|
|
include mempool/Make.defs
|
2021-10-09 09:22:28 +02:00
|
|
|
include kasan/Make.defs
|
2022-08-19 10:09:59 +02:00
|
|
|
include ubsan/Make.defs
|
2012-09-11 22:33:58 +02:00
|
|
|
|
2013-03-20 00:40:07 +01:00
|
|
|
BINDIR ?= bin
|
|
|
|
|
2020-05-19 11:43:29 +02:00
|
|
|
CFLAGS += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)mm}
|
|
|
|
|
2013-03-20 00:40:07 +01:00
|
|
|
AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
|
|
|
|
COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2013-03-08 23:01:50 +01:00
|
|
|
SRCS = $(ASRCS) $(CSRCS)
|
|
|
|
OBJS = $(AOBJS) $(COBJS)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2013-03-08 23:01:50 +01:00
|
|
|
KBIN = libkmm$(LIBEXT)
|
2013-03-20 00:40:07 +01:00
|
|
|
BIN ?= libmm$(LIBEXT)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2013-03-20 00:40:07 +01:00
|
|
|
all: $(BIN)
|
2014-04-13 22:32:20 +02:00
|
|
|
.PHONY: clean distclean
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2013-03-20 00:40:07 +01:00
|
|
|
$(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S
|
2008-01-08 18:06:21 +01:00
|
|
|
$(call ASSEMBLE, $<, $@)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2013-03-20 00:40:07 +01:00
|
|
|
$(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c
|
2008-01-08 18:06:21 +01:00
|
|
|
$(call COMPILE, $<, $@)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2020-05-01 21:23:04 +02:00
|
|
|
# Memory manager for the flat build and
|
|
|
|
# the user phase of the two-pass kernel build
|
2013-03-20 00:40:07 +01:00
|
|
|
|
2007-02-18 00:21:28 +01:00
|
|
|
$(BIN): $(OBJS)
|
2012-11-15 18:43:29 +01:00
|
|
|
$(call ARCHIVE, $@, $(OBJS))
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2013-03-20 00:40:07 +01:00
|
|
|
# Memory manager for the kernel phase of the two-pass kernel build
|
|
|
|
|
2013-03-08 23:01:50 +01:00
|
|
|
ifneq ($(BIN),$(KBIN))
|
2022-05-23 21:43:05 +02:00
|
|
|
$(KBIN): $(OBJS)
|
|
|
|
$(Q) $(MAKE) $(KBIN) BIN=$(KBIN) EXTRAFLAGS="$(EXTRAFLAGS)"
|
2013-03-08 23:01:50 +01:00
|
|
|
endif
|
|
|
|
|
2013-03-20 00:40:07 +01:00
|
|
|
# Dependencies
|
|
|
|
|
2020-11-18 17:44:58 +01:00
|
|
|
makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
|
|
|
|
$(call CATFILE, bin/Make.dep, $^)
|
|
|
|
$(call DELFILE, $^)
|
2020-11-28 04:43:30 +01:00
|
|
|
|
2020-11-18 17:44:58 +01:00
|
|
|
makekdepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
|
|
|
|
$(call CATFILE, kbin/Make.dep, $^)
|
|
|
|
$(call DELFILE, $^)
|
|
|
|
|
2020-07-22 09:54:29 +02:00
|
|
|
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
|
2020-11-28 14:42:54 +01:00
|
|
|
$(Q) $(MAKE) makedepfile OBJPATH="bin"
|
2020-05-01 21:23:04 +02:00
|
|
|
ifneq ($(CONFIG_BUILD_FLAT),y)
|
2020-11-28 14:42:54 +01:00
|
|
|
$(Q) $(MAKE) makekdepfile CFLAGS="$(CFLAGS) $(KDEFINE)" OBJPATH="kbin"
|
2013-09-29 19:46:10 +02:00
|
|
|
endif
|
2012-11-11 19:36:28 +01:00
|
|
|
$(Q) touch $@
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
2013-03-20 00:40:07 +01:00
|
|
|
# Clean most derived files, retaining the configuration
|
2013-03-08 23:01:50 +01:00
|
|
|
|
2007-02-18 00:21:28 +01:00
|
|
|
clean:
|
2020-09-14 18:53:37 +02:00
|
|
|
$(Q) $(MAKE) -C bin clean
|
|
|
|
$(Q) $(MAKE) -C kbin clean
|
2012-11-20 16:47:41 +01:00
|
|
|
$(call DELFILE, $(BIN))
|
2013-03-08 23:01:50 +01:00
|
|
|
$(call DELFILE, $(KBIN))
|
2008-01-10 19:23:08 +01:00
|
|
|
$(call CLEAN)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2013-03-20 00:40:07 +01:00
|
|
|
# Deep clean -- removes all traces of the configuration
|
|
|
|
|
2007-02-18 00:21:28 +01:00
|
|
|
distclean: clean
|
2020-09-14 18:53:37 +02:00
|
|
|
$(Q) $(MAKE) -C bin distclean
|
|
|
|
$(Q) $(MAKE) -C kbin distclean
|
2019-03-19 17:14:50 +01:00
|
|
|
$(call DELFILE, bin/Make.dep)
|
|
|
|
$(call DELFILE, kbin/Make.dep)
|
2012-11-20 16:47:41 +01:00
|
|
|
$(call DELFILE, .depend)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2019-03-19 17:14:50 +01:00
|
|
|
-include bin/Make.dep
|
|
|
|
-include kbin/Make.dep
|