INSTALL = install
INSTDIR1 = /usr/lib/locale/C
INSTDIR2 = /usr/lib/locale/$(LANG)

CATALOGFILES = chgrp.m \
		chmod.m \
		chown.m \
		cp.m \
		df.m \
		mv.m

ENGLISH-SRCS=$(CATALOGFILES:%=English/%)

CHINESE-SRCS=$(CATALOGFILES:%=Chinese/%)


fileutils.cat: all

all: english chinese

english:  $(ENGLISH-SRCS)
	/bin/rm -f fileutils.cat
	gencat -new fileutils.cat $(ENGLISH-SRCS)

chinese:  $(CHINESE-SRCS)
	/bin/rm -f fileutils.cat.chinese
	gencat -new fileutils.cat.chinese $(CHINESE-SRCS)

install: fileutils.cat
	$(INSTALL) -m a+xr -d $(INSTDIR1)
	$(INSTALL) -m a+r fileutils.cat $(INSTDIR1)
	if [ $(LANG) ]; \
	then \
		$(INSTALL) -m a+xr -d $(INSTDIR2); \
		$(INSTALL) -m a+r fileutils.cat.chinese $(INSTDIR2)/fileutils.cat; \
	fi

uninstall:
	/bin/rm -f $(INSTDIR)/fileutils.cat
	if [ $(LANG) ]; \
	then \
		/bin/rm -f $(INSTDIR2)/fileutils.cat; \
	fi

clean:
	/bin/rm -f core fileutils.cat fileutils.cat.chinese

