2009-02-23 08:08:24 +01:00
|
|
|
#
|
|
|
|
# LUFA Library
|
2012-05-27 16:42:30 +02:00
|
|
|
# Copyright (C) Dean Camera, 2012.
|
2010-10-13 16:05:35 +02:00
|
|
|
#
|
2009-02-23 08:08:24 +01:00
|
|
|
# dean [at] fourwalledcubicle [dot] com
|
2010-10-28 08:08:58 +02:00
|
|
|
# www.lufa-lib.org
|
2009-02-23 08:08:24 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
# Makefile to build all the LUFA Projects. Call with "make all" to
|
|
|
|
# rebuild all projects.
|
|
|
|
|
|
|
|
# Projects are pre-cleaned before each one is built, to ensure any
|
|
|
|
# custom LUFA library build options are reflected in the compiled
|
|
|
|
# code.
|
|
|
|
|
2012-07-15 01:04:37 +02:00
|
|
|
PROJECT_DIRECTORIES := $(shell ls -d */)
|
2012-06-03 17:04:10 +02:00
|
|
|
|
2012-06-04 17:38:05 +02:00
|
|
|
# This makefile is potentially infinitely recursive if something really bad
|
|
|
|
# happens when determining the set of project directories - hard-abort if
|
|
|
|
# more than 10 levels deep to avoid angry emails.
|
|
|
|
ifeq ($(MAKELEVEL), 10)
|
|
|
|
$(error EMERGENCY ABORT: INFINITE RECURSION DETECTED)
|
|
|
|
endif
|
|
|
|
|
2012-07-10 21:33:39 +02:00
|
|
|
# Need to special-case building without a per-project object directory
|
2012-06-10 21:39:40 +02:00
|
|
|
ifeq ($(OBJDIR),)
|
2012-07-10 21:33:39 +02:00
|
|
|
# If no target specified, force "clean all" and disallow parallel build
|
2012-07-10 20:30:41 +02:00
|
|
|
ifeq ($(MAKECMDGOALS),)
|
|
|
|
MAKECMDGOALS := clean all
|
2012-07-10 21:33:39 +02:00
|
|
|
.NOTPARALLEL:
|
2012-07-10 20:30:41 +02:00
|
|
|
endif
|
2012-07-10 21:33:39 +02:00
|
|
|
|
|
|
|
# If one of the targets is to build, force "clean" beforehand and disallow parallel build
|
2012-07-10 20:30:41 +02:00
|
|
|
ifneq ($(findstring all, $(MAKECMDGOALS)),)
|
|
|
|
MAKECMDGOALS := clean $(MAKECMDGOALS)
|
2012-07-10 21:33:39 +02:00
|
|
|
.NOTPARALLEL:
|
2012-07-10 20:30:41 +02:00
|
|
|
endif
|
2012-06-10 21:39:40 +02:00
|
|
|
endif
|
2009-10-18 07:35:48 +02:00
|
|
|
|
2012-07-10 20:30:41 +02:00
|
|
|
%: $(PROJECT_DIRECTORIES)
|
|
|
|
@echo . > /dev/null
|
|
|
|
|
|
|
|
$(PROJECT_DIRECTORIES):
|
|
|
|
@$(MAKE) -C $@ $(MAKECMDGOALS)
|
|
|
|
|
|
|
|
.PHONY: $(PROJECT_DIRECTORIES)
|
|
|
|
|