CFLAGS=-Wall -pedantic -D__USE_POSIX2 -I.
LDFLAGS=-lconfig

BINS=test

all: $(BINS)

test: test.o libconfig.a
	$(CC) $(CFLAGS) -o $@ $< -L. -lconfig

LIBOBJS=config.o cread.o cwrite.o

libconfig.a: $(LIBOBJS)
	ar cr $@ $(LIBOBJS)

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

clean:
	rm -f *.o *.a $(BINS)
