libglacier/Makefile

41 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2024-02-08 09:01:44 -05:00
include config.mk
COLOR_GREEN=\033[0;32m
COLOR_BLUE=\033[0;34m
COLOR_RESET=\033[0m
2024-02-08 09:01:44 -05:00
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
2024-10-02 17:30:43 -04:00
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
2024-10-02 17:30:43 -04:00
install:
@echo "$(COLOR_BLUE)[i]$(COLOR_RESET) Installing static library to $(PREFIX)/lib..."
2024-10-02 17:30:43 -04:00
install lib/libglacier.a $(PREFIX)/lib
install include/config.h $(PREFIX)/include/glacier
install include/data.h $(PREFIX)/include/glacier
install include/log.h $(PREFIX)/include/glacier
install include/pkgops.h $(PREFIX)/include/glacier
install include/runtime.h $(PREFIX)/include/glacier
install include/security.h $(PREFIX)/include/glacier
@echo "$(COLOR_GREEN)[*]$(COLOR_RESET) Finished installing static library to $(PREFIX)/lib."
2024-10-02 17:30:43 -04:00
2024-02-08 09:01:44 -05:00
clean:
rm -rf build