mirror of
https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
synced 2024-12-28 04:23:38 +01:00
add installation rules
This commit is contained in:
parent
44bd67431c
commit
38ff31fc47
1 changed files with 71 additions and 10 deletions
|
@ -34,8 +34,8 @@
|
||||||
#---
|
#---
|
||||||
MAJOR := 0
|
MAJOR := 0
|
||||||
MINOR := 2
|
MINOR := 2
|
||||||
PATCH := 4
|
PATCH := 5
|
||||||
EXTRAVERSION := -beta
|
EXTRAVERSION := -rc
|
||||||
|
|
||||||
|
|
||||||
#---
|
#---
|
||||||
|
@ -61,12 +61,6 @@ blue := \033[1;34m
|
||||||
white := \033[1;37m
|
white := \033[1;37m
|
||||||
nocolor := \033[1;0m
|
nocolor := \033[1;0m
|
||||||
|
|
||||||
# This is a workaround to force a newline when the "eval" keyword is involved
|
|
||||||
define n
|
|
||||||
# Force newline character
|
|
||||||
|
|
||||||
endef
|
|
||||||
|
|
||||||
# Define all directory used to stored informations
|
# Define all directory used to stored informations
|
||||||
dir_object := object
|
dir_object := object
|
||||||
dir_output := output
|
dir_output := output
|
||||||
|
@ -114,7 +108,7 @@ first: all
|
||||||
|
|
||||||
|
|
||||||
#---
|
#---
|
||||||
# Automated rules
|
# Generate building rules
|
||||||
#---
|
#---
|
||||||
# common part used to compile source file
|
# common part used to compile source file
|
||||||
# @params:
|
# @params:
|
||||||
|
@ -206,13 +200,80 @@ all: $(generated-libs)
|
||||||
version:
|
version:
|
||||||
@ echo "$(lib-version)"
|
@ echo "$(lib-version)"
|
||||||
|
|
||||||
DEBUG=$(call generate-target,fxlibc-vhex,static,$(dir_objects),$(src))
|
|
||||||
|
#---
|
||||||
|
# Generate installation rules
|
||||||
|
#---
|
||||||
|
# Common rules generated for the installation of each libraries.
|
||||||
|
# Basically, it will generate <libname>-install and <libname>-uninstall rules
|
||||||
|
# @note:
|
||||||
|
# *1 - library pathname
|
||||||
|
define generate-install-rule
|
||||||
|
# generate the rulename
|
||||||
|
# @note: basically, it is the library name
|
||||||
|
lib-basename := $(notdir $1)
|
||||||
|
|
||||||
|
# genetate rule name
|
||||||
|
lib-install-rule := $$(basename $$(lib-basename))-install
|
||||||
|
lib-uninstall-rule := $$(basename $$(lib-basename))-uninstall
|
||||||
|
|
||||||
|
$$(lib-install-rule):
|
||||||
|
install -d $(CONFIG.PREFIX)
|
||||||
|
install $1 -m 644 $(CONFIG.PREFIX)
|
||||||
|
|
||||||
|
$$(lib-uninstall-rule):
|
||||||
|
rm -f $(CONFIG.PREFIX)$$(lib-basename)
|
||||||
|
|
||||||
|
|
||||||
|
# register generated rules into appropriate variable
|
||||||
|
lib-installation-rules += $$(lib-install-rule)
|
||||||
|
lib-uninstallation-rules += $$(lib-uninstall-rule)
|
||||||
|
|
||||||
|
endef
|
||||||
|
|
||||||
|
# internal variable used to store all rules about installation/uninstallation
|
||||||
|
lib-installation-rules :=
|
||||||
|
lib-uninstallation-rules :=
|
||||||
|
|
||||||
|
# generate all installation/ unstallation rules
|
||||||
|
$(foreach libs,$(generated-libs),$(eval \
|
||||||
|
$(call generate-install-rule,$(libs)) \
|
||||||
|
))
|
||||||
|
|
||||||
|
# Generate the include install directory.
|
||||||
|
lib-install-header-dir := $(CONFIG.PREFIX)include/fxlibc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---
|
||||||
|
# Installation rules
|
||||||
|
#---
|
||||||
|
install: $(generated-libs) $(lib-installation-rules)
|
||||||
|
rm -rf $(lib-install-header-dir)
|
||||||
|
cp -r ../include $(lib-install-header-dir)
|
||||||
|
|
||||||
|
uninstall: $(lib-uninstallation-rules)
|
||||||
|
rm -rf $(lib-install-header-dir)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---
|
||||||
|
# debug rule
|
||||||
|
#---
|
||||||
|
#DEBUG=$(call generate-target,fxlibc-vhex,static,$(dir_objects),$(src))
|
||||||
|
DEBUG=$(call generate-install-rule,/output/static/fxlibc.a)
|
||||||
export DEBUG
|
export DEBUG
|
||||||
debug:
|
debug:
|
||||||
@ echo "$$DEBUG"
|
@ echo "$$DEBUG"
|
||||||
@ echo "target-lib: $(target-libs)"
|
@ echo "target-lib: $(target-libs)"
|
||||||
@ echo "generated lib: $(generated-libs)"
|
@ echo "generated lib: $(generated-libs)"
|
||||||
@ echo "target format: $(target-formats)"
|
@ echo "target format: $(target-formats)"
|
||||||
|
@ echo "install-rules: $(lib-installation-rules)"
|
||||||
|
@ echo "uninstall-rules: $(lib-uninstallation-rules)"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#---
|
#---
|
||||||
|
|
Loading…
Reference in a new issue