#
# $RCSfile: Makefile.nolibs,v $
#
# x-kernel v3.3
#
# Copyright (c) 1996,1993,1991,1990  Arizona Board of Regents
#
# $Log: Makefile.nolibs,v $
# Revision 1.5  1996/06/03 23:16:39  slm
# Updated version & copyright.
#
# Revision 1.4  1996/01/30  20:32:15  slm
# Cosmetic changes.
#
# Revision 1.3  1995/10/26  15:51:02  slm
# Fix for mkdir on linux.
#
# Revision 1.2  1995/10/17  22:24:00  slm
# Create .o files in OBJS directories, Makedep files in
# DEPS directories, and ComposeFiles in COMS directories.
#
# Revision 1.1  1995/07/29  02:27:17  slm
# Initial revision
#
# Revision 1.17.1.2  1994/11/22  21:51:53  hkaram
# Added user_level changes
#
# Revision 1.17.1.1  1994/10/28  18:24:43  hkaram
# New branch
#
# Revision 1.17  1994/01/10  18:05:34  menze
#   [ 1993/12/23          menze ]
#   Added filter to let platform-specific files override
#   platform-independent files of the same name.
#
# Makefile directives for building without libraries
#

XLIBS :=

$(XRT)/protocols/COMS/ComposeFiles.$(HOW):
	@if [ ! -d $(dir $@) ] ; then                                 \
	    umask 2 ; mkdir $(shell echo $(dir $@) | sed 's+/$$++') ; \
	    touch $@ ;                                                \
	else                                                          \
	    rm -f $@ ; umask 2 ; touch $@ ;                           \
	fi
#	@make protCompose

$(XRT)/user_level/protocols/COMS/ComposeFiles.$(HOW):
	@if [ ! -d $(dir $@) ] ; then                                 \
	    umask 2 ; mkdir $(shell echo $(dir $@) | sed 's+/$$++') ; \
	    touch $@ ;                                                \
	else                                                          \
	    rm -f $@ ; umask 2 ; touch $@ ;                           \
	fi
#	@make protulCompose

$(XRT)/user_level/platforms/$(XPLATFORM)/COMS/ComposeFiles.$(HOW):
	@if [ ! -d $(dir $@) ] ; then                                 \
	    umask 2 ; mkdir $(shell echo $(dir $@) | sed 's+/$$++') ; \
	    touch $@ ;                                                \
	else                                                          \
	    rm -f $@ ; umask 2 ; touch $@ ;                           \
	fi
#	@make pdCompose

$(XRT)/pi/COMS/ComposeFiles.$(HOW):
	@if [ ! -d $(dir $@) ] ; then                                 \
	    umask 2 ; mkdir $(shell echo $(dir $@) | sed 's+/$$++') ; \
	    touch $@ ;                                                \
	else                                                          \
	    rm -f $@ ; umask 2 ; touch $@ ;                           \
	fi
#	@make piCompose

$(XRT)/user_level/pi/COMS/ComposeFiles.$(HOW):
	@if [ ! -d $(dir $@) ] ; then                                 \
	    umask 2 ; mkdir $(shell echo $(dir $@) | sed 's+/$$++') ; \
	    touch $@ ;                                                \
	else                                                          \
	    rm -f $@ ; umask 2 ; touch $@ ;                           \
	fi
#	@make piulCompose

XK_NO_LIBRARIES := TRUE

# include top level protocol directories

STD_OBJ :=
include $(XRT)/protocols/COMS/ComposeFiles.$(HOW)
include $(XRT)/protocols/ComposeHacks

# the user_level protocol directories will override the ones in the global
# directory

STD_OBJ :=
include $(XRT)/user_level/protocols/COMS/ComposeFiles.$(HOW)
include $(XRT)/user_level/protocols/ComposeHacks

# include user_level platform specific directories

STD_OBJ :=
include $(XRT)/user_level/platforms/$(XPLATFORM)/COMS/ComposeFiles.$(HOW)
include $(XRT)/user_level/platforms/$(XPLATFORM)/ComposeHacks
PLAT_STD_OBJ := $(STD_OBJ)

# include top level pi files

STD_OBJ :=
include $(XRT)/pi/COMS/ComposeFiles.$(HOW)
PI_GLOBAL_STD_OBJ := $(STD_OBJ)

# include user_level pi files

STD_OBJ :=
include $(XRT)/user_level/pi/COMS/ComposeFiles.$(HOW)
PI_LOCAL_STD_OBJ := $(STD_OBJ)

# Files in the user_level pi directory override those in the top-level pi
# directory

PI_FILTERED_OBJ := $(filter-out $(addprefix %/, $(notdir $(PI_LOCAL_STD_OBJ))), $(PI_GLOBAL_STD_OBJ))

# list of all pi object files

PI_STD_OBJ := $(PI_FILTERED_OBJ) $(PI_LOCAL_STD_OBJ)

# Files in the platform-specific area override files by the same name in the
# platform-independent area.  This filter implements that policy.

PI_FILTERED_OBJ := $(filter-out $(addprefix %/, $(notdir $(PLAT_STD_OBJ))), $(PI_STD_OBJ))

# COMPOSE_LIB_OBJ is defined in Makefile.local in the build directory, which
# is built by compose from graph.comp.  It names the collections which should
# be included in the LIB_OBJ object list.

TMP_LIB_OBJ = $(addprefix $(XRT)/,               \
              $(PI_FILTERED_OBJ) $(PLAT_STD_OBJ) \
              $(sort $(COMPOSE_LIB_OBJ)))

# If there is locally compiled source, strip object files with the same name
# from the LIB_OBJ list.

ifeq ($(PRIVOBJ),)
LIB_OBJ = $(TMP_LIB_OBJ)
else
LIB_OBJ = $(filter-out $(addprefix %/, $(notdir $(PRIVOBJ))), $(TMP_LIB_OBJ))
endif

COMPOSE_LIBS := $(sort $(COMPOSE_EXT_LIBS))
