#
# Makefile for locale functions
#

TOPDIR=..

include $(TOPDIR)/Makeconfig
include $(TOPDIR)/Makerules

BASE_CFLAGS:= $(BASE_CFLAGS) -DLOCALE_PATH='"$(HOST_ROOTDIR)/share/locale"' \
-DCHARMAP_PATH='"$(HOST_ROOTDIR)/share/nls/charmap"' -I.

INC_CLAGS= -I.

DIRS:=
SRCS = C-collate.c C-ctype.c C-monetary.c C-numeric.c C-messages.c \
	C-time.c \
	lc-collate.c lc-ctype.c lc-messages.c lc-monetary.c \
	lc-numeric.c lc-time.c \
	loadlocale.c localeconv.c nl_langinfo.c setlocale.c

LDEFSRCS = charmap.c collate.c ctype.c localedef.c locfile-lex.c \
	locfile-parse.c messages.c monetary.c numeric.c
LOCSRCS = ctypedump.c locale.c
PROGLIBS=error.c hash.c xmalloc.c

GPERF=gperf
GPERFFLAGS=-acCgopt -k1,2,5,$$

keyword.h: keyword.gperf
	$(GPERF) $(GPERFFLAGS) $< > $@.new
	mv -f $@.new $@

programs: localedef locale

localedef: $(LDEFSRCS:.c=.o) $(PROGLIBS:.c=.o)
	$(CC) -o $@ $^

locale: $(LOCSRCS:.c=.o) $(PROGLIBS:.c=.o)
	$(CC) -o $@ $^

monetary.o: iso-4217.def
locfile-lex.o: keyword.h hash.h
collate.o ctype.o locfile-lex.o locfile-parse.o monetary.o: token.h
locale.o locfile-parse.o: categories.def
$(LDEFSRCS) $(LOCSRCS) $(PROGLIBS): localedef.h config.h
ctype.o ctypedump.o locale.o locfile-parse.o:

ASMS= $(SRCS:.c=.s)
OBJS= $(SRCS:.c=.o)
ALIASES=

include $(TOPDIR)/Maketargets
