File: Makefile

package info (click to toggle)
tinyos 2.1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 47,476 kB
  • ctags: 36,607
  • sloc: ansic: 63,646; cpp: 14,974; java: 10,358; python: 5,215; makefile: 1,724; sh: 902; asm: 597; xml: 392; perl: 74; awk: 46
file content (50 lines) | stat: -rw-r--r-- 1,533 bytes parent folder | download | duplicates (2)
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
45
46
47
48
49
50
#-*-makefile-*-
######################################################################
# 
# Makes the entire suite of TinyOS applications for a given platform.
#
# Author: 	Martin Turon
# Date:		August 18, 2005
#
######################################################################
# $Id: Makefile,v 1.4 2006-12-12 18:22:48 vlahan Exp $

# MAKECMDGOALS is the way to get the arguments passed into a Makefile ...
TARGET=$(MAKECMDGOALS)
NESDOC_TARGET=$(filter-out nesdoc,$(TARGET))

# Here is a way to get the list of subdirectories in a Makefile ...
ROOT=.
SUBDIRS := $(shell find * -type d)

# Okay, match any target, and recurse the subdirectories
%: 
	@for i in $(SUBDIRS); do \
	  HERE=$$PWD; \
	  if [ -f $$i/Makefile ]; then \
	      echo Building ... $(PWD)/$$i; \
	      echo make $(TARGET); \
	      cd $$i; \
	      $(MAKE) $(TARGET); \
	      cd $$HERE; \
	  fi; \
	done

BASEDIR = $(shell pwd | sed 's@\(.*\)/apps.*$$@\1@' )
# The output directory for generated documentation
DOCDIR = $(BASEDIR)/doc/nesdoc

nesdoc:
	@echo This target rebuilds documentation for all known platforms.
	@echo It DOES NOT overwrite any existing documentation, thus, it 
	@echo is best run after deleting all old documentation.
	@echo
	@echo To delete all old documentation, delete the contents of the
	@echo $(DOCDIR) directory.
	@echo
	@echo Press Enter to continue, or ^C to abort.
	@read
	for platform in `ncc -print-platforms`; do \
	  $(MAKE) $$platform docs.nohtml.preserve; \
	  nesdoc -o $(DOCDIR) -html -target=$$platform; \
	done