DATE:=$(shell date +%y%m%d)

CC=gcc
CPP=gcc -E
CFLAGS=-O -funsigned-char -Wall
DEBUG= -DNO_XMALLOC #-DDEBUG #-DTRACE
LDFLAGS	=
LIBS	=
INCLUDE	= -I.

.c.o:
	$(CC) -g $(INCLUDE) $(CFLAGS) $(DEBUG) -c $<

all:	gtest

clean:
	+rm -f *~ *.o main gtest .depend libi18n.a

delete:
	+rm -f a

OBJS	= res.o misc.o codeset.o code.o ctype.o strings.o
SRCS	= main.c res.c misc.c codeset.c code.c ctype.c strings.c
HEADER	= misc.h debug.h struct.h types.h vars.h

all:	libi18n.a gtest

gtest:	main.o $(OBJS)
	$(CC) $(CFLAGS) $(DEBUG) $(LDFLAGS)  $^  $(LIBS) -o $@

libi18n.a:	$(OBJS)
	+rm -f libi18n.a
	ar rcs $@ $^

dep:
	$(CPP) -MM $(INCLUDE) $(DEBUG) $(SRCS) > .depend

ifeq (.depend,$(wildcard .depend))
include .depend
endif

