#
# Makefile for sash
#
# The HAVE_GZIP definition adds the -gzip and -gunzip commands.
# The HAVE_EXT2 definition adds the -chattr and -lsattr comamnds.
#

CC		= mn10300-linux-gcc
LD		= mn10300-linux-gcc
STRIP		= mn10300-linux-strip -s --remove-section=.comment

SHELL	:= bash

TOP_DIR		= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
ROOT_DIR	= $(TOP_DIR)/../../..
INSTALL_DIR	= $(ROOT_DIR)/usr/bin

CFLAGS = $(RPM_OPT_FLAGS) -Wall -Wmissing-prototypes -DHAVE_EXT2 \
	 -mam33 -pipe -I$(ROOT_DIR)/usr/include -g -O2 -I. #-DHAVE_GZIP
LDFLAGS = -mam33
LIBS =  -lc -lnss_files -lnss_dns -lresolv -lgcc #-lz

BINDIR = /bin
MANDIR = /usr/man/man1


OBJS = sash.o cmds.o cmd_dd.o cmd_ed.o cmd_grep.o cmd_ls.o cmd_tar.o \
	cmd_find.o cmd_file.o cmd_chattr.o cmd_ar.o utils.o dummy.o #cmd_gzip.o


sash:	$(OBJS)
	$(CC) $(LDFLAGS) -o sash $(OBJS) $(LIBS)


clean:
	rm -f $(OBJS) sash

install: sash
	$(STRIP) -o $(INSTALL_DIR)/sash sash
#	cp sash $(BINDIR)/sash
#	cp sash.1 $(MANDIR)/sash.1

$(OBJS):	sash.h
