(file) Return to Makefile CVS log (file) Jump to this file's LXR Page (dir) Up to [CENS] / emstar

File: [CENS] / emstar / Makefile (download)
Revision: 1.58, Fri Jan 27 06:14:31 2006 UTC (3 years, 9 months ago) by girod
Branch: MAIN
Changes since 1.57: +43 -7 lines
improved the help, moved configure into the pre-make stage

#
# CENS EmStar Repository Master Makefile
#
# $Id: Makefile,v 1.58 2006/01/27 06:14:31 girod Exp $
#

################### NOTE!!!! ###########################
## Most of the time you want to edit the files called ##
## 'BUILD' and Make.conf, NOT this Makefile.          ##
########################################################


## Sets user-modifiable variables
## e.g. enable TOS, Kernel, native kernel headers, etc
include Make.conf

## If this is the native arch, include config.make
ifeq ($(strip $(ARCH)),i686-linux)
  IS_NATIVE=1
else
  ifeq ($(ARCH),)
    IS_NATIVE=1
  endif
endif

include make/make.tinyos

# Set platform-dependent variables.  Including this fragment sets:
#  ARCH -- the target architecture (e.g., arm-linux or i686-linux)
#  NATIVE_ARCH -- the architecture we're compiling under
#  CC, CPP, AR, LD, BINSTRIP -- paths to various utils
include make/make.platform
OBJDIR := obj.$(ARCH)

# the default target
.DEFAULT default:  config.make
	@make -f Makefile.main $0

clean:
	if [[ ! ( . -ef ./$(OBJDIR) ) ]] ; then rm -rf ./$(OBJDIR) ; fi
ifeq ($(strip $(IS_NATIVE)), 1)
	rm -f config.make	
	rm -f make/config.h
endif

##
##  The 'help' target.
##  This target provides info about what vars are set and
##  what platforms are available
##

# For debugging purposes, a rule that shows the environment
# and active variables..
help:
	@echo Help:
	@echo ""
	@echo " make ARCH=<platform> [executable path]"
	@echo "   Builds specified file or all executables and libraries"
	@echo 
	@echo " make clean ARCH=<platform>"
	@echo "   deletes all built files."
	@echo ""
	@echo " make strip ARCH=<platform>"
	@echo "   strips symbols from all executables."
	@echo ""
	@echo " make help -- provides this message"
	@echo ""
	@echo " make config -- runs configure for native platform"
	@echo ""
	@echo " EmStar supports the following platforms:"
	@echo 
	@echo "  i686-linux (default) is the 'native' platform"
	@echo "    used to buld to run on your host.  Check Make.conf"
	@echo "    to locally customize the native platform."
	@echo 
	@echo "  stargate builds for Stargate release 7"
	@echo "  nims-stargate builds for Slauson platform"
	@echo "  arm-linux builds for iPAQ"
	@echo 
	@echo "  stargate-ucla builds for Stargate UCLA release 5"
	@echo "  ipaq-sa builds for all StrongARM-based iPAQs (Familiar)"
	@echo "  pasta builds for PASTA"
	@echo "  ilense-104 builds for the ilense testbed"
	@echo 
	@echo "  mica, mica2, mica2dot, cricket, micaz, telos"
	@echo "        build Mote targets"
	@echo 
	@echo Environment:
	@echo " NATIVE_KCFLAGS=$(NATIVE_KCFLAGS)"
	@echo " PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)"
	@echo " GLIB_PATH=$(GLIB_PATH)"
	@echo " USE_SHARED='$(USE_SHARED)'"
	@echo " BUILD_EMTOS='$(BUILD_EMTOS)'"
	@echo " TOSDIR=$(TOSDIR)"
	@echo " TOS_CONTRIB=$(TOS_CONTRIB)"
	@echo " MAKERULES=$(MAKERULES)"
	@echo " NESC_DIR=$(NESC_DIR)"
	@echo " AVR_DIR=$(AVR_DIR)"

configure:
	@echo "Running autoconf..."
	autoconf

config make/config.h: configure
	@echo "Running ./configure..."
	@./configure || ( echo "Configure failed."; exit 1 )

ifeq ($(strip $(IS_NATIVE)), 1)
config.make:  make/config.h 
	@echo "Building config.make..."
	perl make/htosh.pl $(PWD)
else
config.make:  
	@true
endif

CENS CVS Mailing List
Powered by
ViewCVS 0.9.2