# makefile for atoms for (gcc)
# runs under DOS and OS/2
#
TARGET_NAME = libatoms.a

FLAGS=-Wall -I./include/
#FLAGS+=-DERROR_HANDLER
CFLAGS=@CPPFLAGS@ @CFLAGS@ @OPTIMIZE_CFLAGS@ $(FLAGS)
CXXFLAGS=@CPPFLAGS@ @CXXFLAGS@ @OPTIMIZE_CFLAGS@ $(FLAGS)

OBJ=.o

OBJECTS=struct$(OBJ)

%OBJECTS=containe$(OBJ)
OBJECTS+=dbllist$(OBJ)
OBJECTS+=sets$(OBJ)
OBJECTS+=std_str$(OBJ)
OBJECTS+=struct$(OBJ)
OBJECTS+=lists$(OBJ)
OBJECTS+=strings$(OBJ)
OBJECTS+=stack$(OBJ)

OBJECTS+=utf8$(OBJ)
OBJECTS+=mtx_impl$(OBJ)


.SUFFIXES: .c .cc $(OBJ) .exe .a

.cc$(OBJ):
	@CXX@ $(CXXFLAGS) $(DEBUG) -c $*.cc $(ERROR) -o $*$(OBJ) $(GETTEXT)

.c$(OBJ):
	@CC@ $(CFLAGS) $(DEBUG) -c $*.c $(ERROR) -o $*$(OBJ) $(GETTEXT)


$(TARGET_NAME): $(OBJECTS)
	ar rcs $(TARGET_NAME) $(OBJECTS)


struct$(OBJ):	struct.c
utf8$(OBJ):	utf8.c

%complex$(OBJ):	complex.cc
containe$(OBJ):	containe.cc
interval$(OBJ):	interval.cc include/interval.h
std_str$(OBJ):	std_str.cc include/std_str.h
stack$(OBJ):	stack.cc include/stacks.h
sets$(OBJ):	sets.cc include/sets.h
strings$(OBJ):	strings.cc include/stringa.h


all:     $(TARGET_NAME)
#	cp -f strings/*.h include/*.h
#	cp -f sets/*.h include/*.h


default: $(TARGET_NAME)


clean:
	rm -f $(TARGET_NAME) *.exe *$(OBJ) *.obj *.o *.bak core *.bak *.bkp *.a
	rm -f include/*.bak include/*.bkp


distclean: clean
	cp include/common.h.gen include/common.h
	cp makefile.gen makefile

generic:
	cp include/common.h.gen include/common.h
	rm makefile
	cp makefile.gen makefile

