CC	= gcc
CXX	= g++
CFLAGS	= -O2 -Wall -D_LINUX_
AR	= ar

SRCS = i2cbus.cpp wait.cpp rs232int.cpp ds1621.cpp readtemp.cpp
OBJS = $(SRCS:.cpp=.o)

all:	libtherm.a
	cd cgitherm; $(MAKE)
	cd tcp-ip; $(MAKE)

libtherm.a:	$(OBJS)
	rm -f libtherm.a
	$(AR) cr libtherm.a $(OBJS)

clean:
	rm -f core libtherm.a $(OBJS)
	cd cgitherm; $(MAKE) clean
	cd tcp-ip; $(MAKE) clean

%.o: %.cpp
	$(CXX) $(CFLAGS) -c $< -o $@

dep:
	$(CXX) -MM $(CFLAGS) $(SRCS) >dep.file

dep.file:
	$(CXX) -MM $(CFLAGS) $(SRCS) >dep.file

#
# include a dependency files
#
#include $(SRCS:.cpp=.d)

include dep.file
