#
#	@(#)Makefile (tools)
#		GNU make 
#
#	ʥġ
#	(C) Copyright 1997-1998 by Personal Media Corporation
#
#	make ˡ
#	make
#		꡼ѤǤ
#	make mode=debug
#		ǥХåѤ˺
#	make clean
#		make ǺƤΥե
#	make install
#		ξ˥󥹥ȡ
#

# ΰ¸طե (ư)
DEPS = Dependencies
DEPENDENCIES_OUTPUT := $(DEPS)

# ɸ롼
include ../../../etc/makerules

#-----------------------------------------------------------------------------

# о
  TARGET = bzcomp mkbtf

# եΥѥ
S = ../src
VPATH = $S

# ե
SRC := $(notdir $(wildcard $(TARGET:%=$S/%.*)))

OBJ	= $(addsuffix .o, $(basename $(SRC)))
SRC.C	= $(filter %.C, $(SRC))

HEADER := $(S) $(HEADER)

#-----------------------------------------------------------------------------

.PHONY: all install clean

ALL = $(TARGET) # $(addsuffix .map, $(TARGET))

all: $(ALL)

clean:
	$(RM) $(OBJ) $(SRC.C:%.C=%.c) $(ALL) $(DEPS)

install: $(addprefix $(TOOL_INSTALLDIR)/, $(ALL))


# ΰ¸ط
ifdef DEPENDENCIES_OUTPUT
  $(DEPS): ; touch $(DEPS)
else
  $(DEPS): $(SRC) ; $(MAKEDEPS) $@ $?
endif
include $(DEPS)

$(SRC.C:%.C=%.c):
$(OBJ):
