summaryrefslogtreecommitdiffstats
path: root/build_tools/makefile
blob: c07f7acaea1cd15a58c3549e88100f3abcdc095c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# makefile for LinHES (aka KnoppMyth) R6 development.
#
#########################################################################
# Configuration:							#
#-----------------------------------------------------------------------#
# Directory within which are the profiles:
PRODIR		= larch/profiles
# The list of profiles to support:
PROFILES	= dev local
# directory within which to build:
SUBDIR		= clarch
#-----------------------------------------------------------------------#
# Default iso image name:
DEFAULT = LinHES.iso
# The directory of the resulting iso image:
RESDIR		= /tmp
# full pathname to the iso built release file:
RELFILE		= /home/larchroot/etc/LinHES-release
# Name of the created CDROM image:
CDFILE		= /home/larchroot/.larch/mylivecd.iso
#########################################################################
# Targets:								#
#-----------------------------------------------------------------------#
# The default target:
Help help:
	@echo ""
	@echo "Usage: 'make <profile>' where <profile> is one of:"
	@echo "        $(PROFILES)"
	@echo "    to make a $(RESULT) file of that profile."
	@echo ""
#-----------------------------------------------------------------------#
CMD = mklarch -f -p $(PRODIR)
$(PROFILES) :
	@clear ; cd $(SUBDIR) && \
	echo -e "\nBeginning \e[1m$(CMD)/R6-$@\e[0m" && \
	time ./$(CMD)/R6-$@ -c /tmp/R6-$@ 2>&1 && \
	ISOIMG="$(DEFAULT)" && [ -f "$(RELFILE)" ] && \
	ISOIMG="$$(cat $(RELFILE) | sed 's/ /_/g').iso" &&  \
	IMAGE="$(RESDIR)/$${ISOIMG}" && mv -f $(CDFILE) $${IMAGE} && \
	echo -e "\nThe iso is now located at \e[1m$${IMAGE}\e[0m\n" && \
	[ "$(DEFAULT)" != "$${ISOIMG}" ] && { cd $(RESDIR) && \
	rm -f $(DEFAULT) ; ln -s $${ISOIMG} $(DEFAULT) ; }
#######################################################################
# End