# EPOS Main Makefile
#
# Author: Guto
# Last updated: 26 Apr 2001

# Definitions
include $(EPOS)/makedefs

# Rules
all:		tools src img

tools:		FORCE
		(cd tools && $(MAKE))

src:		FORCE
		(cd src && $(MAKE))

img:		FORCE
		(cd img && $(MAKE))

drivers:	FORCE
		(cd drivers && $(MAKE))

apps:		FORCE
		(cd apps && $(MAKE))

sh:
		$(SHELL)

test:		FORCE
		(cd src && $(MAKE) test)

print_headers:	FORCE
		$(PRINT1) $(INCLUDE)/system_object.h \
		$(INCLUDE)/system/system_object.h \
		$(PRINT2)
		$(PRINT1) $(INCLUDE)/system_object_id.h \
		$(INCLUDE)/system/system_object_id.h \
		$(INCLUDE)/system/local_system_object_id.h \
		$(INCLUDE)/system/global_system_object_id.h \
		$(INCLUDE)/system/protected_system_object_id.h \
		$(PRINT2)
		$(PRINT1) $(INCLUDE)/system/system_object_stub.h $(PRINT2)
		$(PRINT1) $(INCLUDE)/system/system_object_handle.h $(PRINT2)

print:		print_headers
		(cd src && $(MAKE) print)
		(cd tools && $(MAKE) print)
#		(cd drivers && $(MAKE) print)
#		(cd apps && $(MAKE) print)

clean:		FORCE
		-(cd src && $(MAKE) clean)

distclean:	clean
		-(cd drivers && $(MAKE) clean)
		-(cd tools && $(MAKE) clean)
		-(cd apps && $(MAKE) clean)
		-(cd test && $(MAKE) clean)
		-(cd img && $(MAKE) clean)
		$(CLEAN) $(INCLUDE)/elf-linux.h
		$(CLEAN) $(LIB)/*.o $(LIB)/*.a
		$(CLEAN) $(BIN)/*

FORCE:
