#------------------------------------------------------------------------------
# Makefile,v 1.11.2.2 2004/02/13 21:44:15 dgregoire Exp
# 
#
# This source code copyright (c) Hexago Inc. 2002-2004.
#
# This program is free software; you can redistribute it and/or modify it 
# under the terms of the GNU General Public License (GPL) Version 2, 
# June 1991 as published by the Free  Software Foundation.
#
# This program is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY;  without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License 
# along with this program; see the file GPL_LICENSE.txt. If not, write 
# to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
# MA 02111-1307 USA
#
subdirs=src/net src/lib src/tsp src/xml platform/linux

all: pre-checks
	for dir in ${subdirs}; do \
		(cd $$dir && $(MAKE) all) \
		|| exit 1; \
	done

pre-checks:
	mkdir -p bin
	mkdir -p objs

romfs:
	$(ROMFSINST) bin/tspc /bin/tspc
	$(ROMFSINST) -p 700 -d template/linux.sh /etc_ro/tsp/template/linux.sh
	$(ROMFSINST) -p 700 -d tspc_check.sh /etc_ro/tsp/tspc_check
	(test -f $(ROMFSDIR)/dev/net/tun) || (mkdir -p $(ROMFSDIR)/dev/net; \
	mknod $(ROMFSDIR)/dev/net/tun c 10 200; \
	chmod 700 $(ROMFSDIR)/dev/net/tun)

clean: pre-checks
	for dir in ${subdirs}; do \
		(cd $$dir && $(MAKE) clean) \
		|| exit 1; \
	done
	rm -rf bin/tspc objs
