include config.mk

all:
	@echo "Run 'make test' for the test binary, or 'make lib' to generate a static library."
	@echo "Run 'make help' for a full list of options."

help:
	@echo "Make options for libglacier:"
	@echo ""
	@echo "lib   - generate the static library"
	@echo "test  - generate a test binary"
	@echo "clean - remove all generated files"

test:
	$(CC) libglacier.c $(LIBFLAGS) -o libglacier.test
	cp etc/example.cfg ./glacier.cfg

lib:
	mkdir build
	mkdir build/lib
	$(CC) libglacier.c -c $(LIBFLAGS) -o build/lib/libglacier.o
	$(AR) -rc build/lib/libglacier.a build/lib/libglacier.o

install:
	install lib/libglacier.a $(PREFIX)/lib
	install include/glacier_config.h $(PREFIX)/include
	install include/glacier_log.h $(PREFIX)/include
	install include/glacier_pkgops.h $(PREFIX)/include
	install include/glacier_runtime.h $(PREFIX)/include

clean:
	rm -rf build