62 lines
1.7 KiB
Makefile
62 lines
1.7 KiB
Makefile
#
|
|
# Makefile
|
|
#
|
|
|
|
IDIR = ./include
|
|
BDIR = ./build
|
|
SDIR = ./src
|
|
|
|
include config.mk
|
|
|
|
all:
|
|
@echo "No make option specified."
|
|
@echo "Run 'make help' for a full list of options."
|
|
|
|
help:
|
|
@echo "Make options for libglacier:"
|
|
@echo ""
|
|
@echo "lib - generate the static library"
|
|
@echo "install - install the static library and header files to PREFIX"
|
|
@echo "clean - remove all generated files"
|
|
|
|
deprecate:
|
|
@echo "[WARN]"
|
|
@echo "[WARN] This rule has been deprecated, proceed with caution."
|
|
@echo "[WARN]"
|
|
|
|
test: deprecate
|
|
$(CC) libglacier.c $(LIBFLAGS) -o libglacier.test
|
|
cp etc/example.cfg ./glacier.cfg
|
|
|
|
lib: $(SDIR)/libglacier.c
|
|
mkdir build
|
|
mkdir build/lib
|
|
$(CC) $(SDIR)/libglacier.c -c $(LIBFLAGS) -o $(BDIR)/lib/libglacier.o
|
|
$(AR) -rc $(BDIR)/lib/libglacier.a build/lib/libglacier.o
|
|
|
|
install_lib: $(BDIR)/lib/libglacier.a
|
|
@echo "[INFO]"
|
|
@echo "[INFO] Installing library to PREFIX/lib..."
|
|
@echo "[INFO]"
|
|
install $(BDIR)/lib/libglacier.a $(PREFIX)/lib
|
|
|
|
install_head: $(IDIR)/config.h $(IDIR)/data.h $(IDIR)/log.h $(IDIR)/pkgops.h $(IDIR)/runtime.h $(IDIR)/security.h
|
|
@echo "[INFO]"
|
|
@echo "[INFO] Installing header files to PREFIX/include/glacier..."
|
|
@echo "[INFO]"
|
|
mkdir -p $(PREFIX)/include/glacier
|
|
install $(IDIR)/config.h -t $(PREFIX)/include/glacier -m 644
|
|
install $(IDIR)/data.h -t $(PREFIX)/include/glacier -m 644
|
|
install $(IDIR)/log.h -t $(PREFIX)/include/glacier -m 644
|
|
install $(IDIR)/pkgops.h -t $(PREFIX)/include/glacier -m 644
|
|
install $(IDIR)/runtime.h -t $(PREFIX)/include/glacier -m 644
|
|
install $(IDIR)/security.h -t $(PREFIX)/include/glacier -m 644
|
|
|
|
install: install_lib install_head
|
|
@echo "[INFO]"
|
|
@echo "[INFO] Finished installing library and header files to PREFIX."
|
|
@echo "[INFO]"
|
|
|
|
clean:
|
|
rm -rf $(BDIR)
|