Previous: , Up: Anatomy of a GSRC Makefile   [Contents]


A.2.5 A complex example

NAME = Linux Libre
GARNAME = linux-libre
GARVERSION = 3.8.5
HOME_URL = http://www.fsfla.org/svnwiki/selibre/linux-libre/
DESCRIPTION = A free version of the Linux kernel
define BLURB
Linux Libre is a free (as in freedom) variant of the Linux kernel.
It has been modified to remove any non-free binary blobs.
endef

######################################################################

MASTER_SITES = http://linux-libre.fsfla.org/pub/
MASTER_SUBDIR = $(GARNAME)/releases/$(GARVERSION)-gnu/
DISTFILES = $(DISTNAME)-gnu.tar.xz
SIGFILES = $(DISTNAME)-gnu.tar.xz.sign

WORKSRC = $(WORKDIR)/linux-$(GARVERSION)
CONFIGURE_SCRIPTS = $(WORKSRC)/Makefile
BUILD_SCRIPTS = $(WORKSRC)/Makefile
INSTALL_SCRIPTS = kernel

BUILDDEPS =
LIBDEPS =

######################################################################

include ../../gar.mk
include config.mk

CONFIGURE_ARGS = $(CONFIGURE_OPTS)
BUILD_ARGS += $(if $(USE_PARALLEL),$(MAKE_ARGS_PARALLEL),)

CREATED_MERGE_DIRS = \
	sysconf $(sysconfdir) \
	var $(vardir) \
	rootlib /lib

pre-configure:
	make -C $(WORKSRC) mrproper
	$(MAKECOOKIE)

configure-%/Makefile:
	$(CONFIGURE_ENV) make -C $* $(MAKE_ARGS) $(CONFIGURE_ARGS) $(CONFIGURE_TARGET)
	$(MAKECOOKIE)

post-configure:
	cd $(WORKSRC) && make $(MAKE_ARGS) prepare
	$(MAKECOOKIE)

build-%/Makefile:
	$(BUILD_ENV) make -C $* $(BUILD_ARGS)
	$(MAKECOOKIE)

install-kernel:
	make -C $(WORKOBJ) $(MAKE_ARGS) \
		INSTALL_MOD_PATH=$(packageprefix) \
		INSTALL_HDR_PATH=$(packageprefix) \
		modules_install \
		headers_install \
		firmware_install
	@install -m755 -D $(WORKSRC)/arch/$(ARCH)/boot/bzImage $(packageprefix)/boot/vmlinuz-$(DISTNAME)
	@install -m755 $(WORKSRC)/System.map $(packageprefix)/boot/System.map-$(GARVERSION)
	@install -m755 $(WORKSRC)/.config $(packageprefix)/boot/config-$(GARVERSION)
	$(MAKECOOKIE)