
CC = LANG=C gcc
LD = ld

CFLAGS += -pthread -g -Wall -O0
LDFLAGS += -pthread -g


TARGETC = sampleclient
COBJ = sampleclient.o

TARGETS = sampleserver
SOBJ = sampleserver.o

LIB = ../libhtlib.a
OBJS = htlib.o HtLib_.o log.o Socket.o Header.o Thread.o \
	Sender.o Receiver.o Date.o
	

all: $(TARGETC) $(TARGETS)

$(TARGETC): $(COBJ) $(LIB)
	$(CC) $(LDFLAGS) -o $@ $(COBJ) $(LIB)

$(TARGETS): $(SOBJ) $(LIB)
	$(CC) $(LDFLAGS) -o $@ $(SOBJ) $(LIB)

$(LIB): $(OBJS)
	ar rcv $@ $(OBJS)

clean:
	rm -f $(TARGET) $(TOBJ) $(LIB) $(OBJS) *~

test:
	./$(TARGET) http://localhost/~hideki/a.cgi
