# 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)


COMMONDEP=include/common.h $(MAKEFILE_LIST)


.SUFFIXES: .c .cc $(OBJ) .exe .a
.PHONY: all default distclean generic clean


.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 $(COMMONDEP) include/struct.h
utf8$(OBJ):	utf8.c $(COMMONDEP)

%complex$(OBJ):	complex.cc $(COMMONDEP)
containe$(OBJ):	containe.cc $(COMMONDEP)
interval$(OBJ):	interval.cc $(COMMONDEP) include/interval.h
std_str$(OBJ):	std_str.cc $(COMMONDEP) include/std_str.h
stack$(OBJ):	stack.cc $(COMMONDEP) include/stacks.h
sets$(OBJ):	sets.cc $(COMMONDEP) include/sets.h
strings$(OBJ):	strings.cc $(COMMONDEP) 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

