https://gitlab.inria.fr/pm2/pm2
Tip revision: 37ad8e96afc4fddf9ef04adf631381a23b78bb63 authored by Samuel Thibault on 06 June 2005, 12:59:22 UTC
profilage
profilage
Tip revision: 37ad8e9
Makefile
# PM2: Parallel Multithreaded Machine
# Copyright (C) 2001 "the PM2 team" (see AUTHORS file)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# Numéro de version majeur (pour une bibliothčque dynamique)
# 0 nécessaire pour la libpthread
#---------------------------------------------------------------------
LIB_SO_MAJ=0
# Inclusion des makefiles generiques
#---------------------------------------------------------------------
include $(PM2_ROOT)/make/libs-vars.mak
DO_NOT_GENERATE_MAK_FILES += _clean_autogen_
# TODO LIBNAME devrait provenir des fichiers de la flavor
#---------------------------------------------------------------------
ifeq ($(LIBPTHREAD),true)
LIBNAME=pthread
endif
SCHED_NAME=marcel
MOD_HSPLITS_COMMON:=splitall_section_def.h
MOD_HSPLITS_SOURCES:=$(shell echo `pwd` 1>&2 ; cd include ; \
grep -l '^\#section' *.h sys/*.h)
#MOD_HSPLITS_GENDIR ?= $(MOD_GEN_INC)
MOD_HSPLITS_GENDIR = $(CURDIR)/autogen-include
MOD_SRC += source/scheduler-$(SCHED_NAME)
MOD_SRC += source/arch-$(MOD_ARCH)
MOD_SRC += source/arch-generic
$(eval $(call MOD_HSPLITS_ADD_MASTER,,,))
#$(warning $(call MOD_HSPLITS_ADD_MASTER,,,))
define ADD_SUBDIR # subdir SUBNAME base
$$(eval $$(call MOD_HSPLITS_ADD_MASTER,-$(1),_$(2),$(1)))
MOD_HSPLITS_PARTS_$(2) += MOD_HSPLITS_$(2)_section MOD_HSPLITS_$(2)_nosection
MOD_HSPLITS_$(2)_section_COMMON:=splitall_section_def.h
MOD_HSPLITS_$(2)_section_SRCDIR:=include/$(1)
MOD_HSPLITS_$(2)_section_GENSUBDIR:=$(1)
MOD_HSPLITS_$(2)_section_DEFAULT_SECTION:=null
MOD_HSPLITS_$(2)_SOURCES:=$$(patsubst include/$(1)/%,%,$$(wildcard include/$(1)/*.h))
MOD_HSPLITS_$(2)_section_SOURCES=$$(shell cd include/$(1); grep </dev/null -l '^\#section' $$(MOD_HSPLITS_$(2)_SOURCES))
MOD_HSPLITS_$(2)_nosection_COMMON:=splitall_nosection_def.h
MOD_HSPLITS_$(2)_nosection_SRCDIR:=include/$(1)
MOD_HSPLITS_$(2)_nosection_GENSUBDIR:=$(1)
MOD_HSPLITS_$(2)_nosection_DEFAULT_SECTION:=all
MOD_HSPLITS_$(2)_nosection_SOURCES=$$(filter-out $$(MOD_HSPLITS_$(2)_section_SOURCES),$$(MOD_HSPLITS_$(2)_SOURCES))
endef
#ifeq ($(MOD_ARCH),)
#$(warning MOD_ARCH not defined)
#endif
#ifeq ($(SCHED_NAME),)
#$(warning SCHED_NAME not defined)
#endif
$(eval $(call ADD_SUBDIR,asm-generic,ARCH_GENERIC))
$(if $(MOD_ARCH),$(eval $(call ADD_SUBDIR,asm-$(MOD_ARCH),ARCH)))
$(if $(SCHED_NAME),$(eval $(call ADD_SUBDIR,scheduler-$(SCHED_NAME),SCHED)))
.PHONY: symlinks
dot_h: symlinks
symlinks: $(MOD_GEN_INC)/asm $(MOD_GEN_INC)/scheduler
$(MOD_GEN_INC)/asm:
$(COMMON_BUILD)
-$(COMMON_MAIN) ln -sf $(MOD_HSPLITS_GENDIR)/asm-$(MOD_ARCH) $@
$(MOD_GEN_INC)/scheduler:
$(COMMON_BUILD)
-$(COMMON_MAIN) ln -sf $(MOD_HSPLITS_GENDIR)/scheduler-$(SCHED_NAME) $@
.PHONY: clean_autogen
clean: clean_autogen
clean_autogen:
$(COMMON_CLEAN) $(RM) -r autogen-include
#$(foreach rep,$(patsubst include/%,%, \
# $(wildcard include/asm-* include/scheduler-*)), \
# $(eval $(call ADD_SUBDIR,$(rep),$(rep))))
#sys/marcel_sched.h scheduler/sched_marcel.h marcel_alias.h \
# marcel_threads.h
# Inclusion des makefiles generiques
#---------------------------------------------------------------------
include $(PM2_ROOT)/make/libs-rules.mak
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Rčgles locales pour maintenir ŕ jour les fichiers provenant
# des sources du noyaux linux
# Récupération du nom des fichiers originaux
KFILES=$(shell find include source -iname "linux_*.[ch]" | \
sed -e 's,^.*/old/.*$$,,' \
-e 's,\(asm[^/]*/\)linux_,\1,' \
-e 's,include/\(asm-.*\)/linux_,include/\1/,' \
-e 's,include/.*linux_,include/linux/,' \
-e 's,source/.*linux_,kernel/,' \
-e 's,lwp,cpu,' \
-e 's,kernel/notifier.c,kernel/sys.c,')
# Répertoire contenant (ou lien vers) les sources du noyau
KDIR= linux_tree
# Répertoire contenant la copie des fichiers du noyau que l'on a adapté ŕ marcel
COPYDIR=linux_archive
.PHONY: linux
linux:
$(COMMON_MAIN)set -e ; LST="" ; \
for f in $(KFILES) ; do \
if [ ! -f $(COPYDIR)/$$f ]; then \
echo "Copying new file $$f"; \
mkdir -p $$(dirname $(COPYDIR)/$$f); \
bk get $(KDIR)/$$f 2>/dev/null || true ; \
if [ ! -f $(KDIR)/$$f ]; then \
echo "No $$f in $(KDIR) !!!" ;\
else \
cp -a $(KDIR)/$$f $(COPYDIR)/$$f ; \
fi ; \
elif cmp --quiet $(KDIR)/$$f $(COPYDIR)/$$f; then \
: ;\
else \
echo "$$f has been updated in kernel sources" ; \
fi ; \
done
$(COMMON_MAIN)set -e ; LST=""; KFILES="$(KFILES)" ; \
for f in $$(find $(COPYDIR) -type d -name SCCS -prune -o -type f -printf "%P\n") ; do \
case " $$KFILES " in \
*\ $$f\ *) ;; \
*) echo "$$f: present in archive but not in sources (to remove ?)" ; \
LST="$$LST $(COPYDIR)/$$f" ;; \
esac ; \
done ; \
if [ ! -z "$$LST" ]; then \
echo "You should verify and execute : " ; \
echo "rm -v $$LST" ; \
fi