cake
/
p7utils
Archived
1
0
Fork 0

Added 'dist' target, corrected gestion of git modules

This commit is contained in:
Thomas Touhey 2016-12-27 02:31:59 +01:00
parent ef1ab75f18
commit b6453c3aa8
2 changed files with 37 additions and 6 deletions

View File

@ -4,6 +4,9 @@
#******************************************************************************#
include Makefile.vars Makefile.msg
# Check if we're a git repository
ISGIT := $(shell test -e .git && echo y)
#******************************************************************************#
# General targets #
#******************************************************************************#
@ -35,8 +38,34 @@ uninstall: uninstall-bins uninstall-doc
# Reinstall it all
reinstall: uninstall install
# Make dist
dist: mrproper $(if $(ISGIT),reinit-gitmodules)
$(call bcmd,tarball,$(NAME)-$(VERSION),\
tar czf $(NAME)-$(VERSION).tar.gz \
--exclude .git --transform "s/^/$(NAME)-$(VERSION)\//" *)
.PHONY: all mostlyclean mclean clean fclean mrproper re
.PHONY: install uninstall reinstall
.PHONY: dist install uninstall reinstall
#******************************************************************************#
# Git submodules #
#******************************************************************************#
# Main rule.
reinit-gitmodules:
@git submodule deinit --all
@git submodule update --init --recursive
# Initialize one module
ifeq ($(ISGIT),y)
define check-gitmodule
-$(call qcmd,git submodule update --init --quiet $1)
endef
else
define check-gitmodule
@true
endef
endif
.PHONY: reinit-gitmodules
#******************************************************************************#
# Configuration (version) checking dependencies #
#******************************************************************************#
@ -93,10 +122,12 @@ ifeq ($(shell test -f $(SRCDIR)/$1/$2.c && echo y),y)
else
# - Out of an update.exe project
$(SRCDIR)/$1/$2.exe/$2.exe.bin:| $(SRCDIR)/$1/$2.exe
-$(call qcmd,test -e .git && ! test -e $(SRCDIR)/$1/$2.exe/.git && \
git submodule update --init $(SRCDIR)/$1/$2.exe)
$(call qcmd,cd $$| && ./configure)
$(call bcmd,make,$2.exe,$(MAKE) $$| $2.exe.bin | sed -e 's/^/ /')
$(call check-gitmodule,$(SRCDIR)/$1/$2.exe)
$(if $(shell test -f $(SRCDIR)/$1/$2.exe/configure \
&& test -x $(SRCDIR)/$1/$2.exe/configure && echo y), \
$(call qcmd,cd $(SRCDIR)/$1/$2.exe && ./configure 1>/dev/null))
$(call bcmd,make,$2.exe,$(MAKE) -C $(SRCDIR)/$1/$2.exe $2.exe.bin \
| sed -e 's/^/ /')
$(OBJDIR)/$1/$2.o: $(SRCDIR)/$1/$2.exe/$2.exe.bin | $(OBJDIR)/$1
$(call bcmd,ld -r,$$@,cd $(SRCDIR)/$1/$2.exe && \

View File

@ -80,7 +80,7 @@
LDR := $(TARGET)ld -r
# Maker
MAKE := make -C
MAKE := make --no-print-directory
# Directory maker
MD := mkdir -p
# File remover