diff --git a/Makefile b/Makefile index 4c33ebc..cada247 100644 --- a/Makefile +++ b/Makefile @@ -1,40 +1,60 @@ +# +# Makefile +# + +IDIR = ./include +BDIR = ./build +SDIR = ./src + include config.mk -COLOR_GREEN=\033[0;32m -COLOR_BLUE=\033[0;34m -COLOR_RESET=\033[0m - all: - @echo "Run 'make test' for the test binary, or 'make lib' to generate a static library." + @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 "test - generate a test binary" + @echo "install - install the static library and header files to PREFIX" @echo "clean - remove all generated files" -test: +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: +lib: $(SDIR)/libglacier.c 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 + $(CC) $(SDIR)/libglacier.c -c $(LIBFLAGS) -o $(BDIR)/lib/libglacier.o + $(AR) -rc $(BDIR)/lib/libglacier.a build/lib/libglacier.o -install: - @echo "$(COLOR_BLUE)[i]$(COLOR_RESET) Installing static library to $(PREFIX)/lib..." - 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." +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]" + install $(IDIR)/config.h $(PREFIX)/include/glacier + install $(IDIR)/data.h $(PREFIX)/include/glacier + install $(IDIR)/log.h $(PREFIX)/include/glacier + install $(IDIR)/pkgops.h $(PREFIX)/include/glacier + install $(IDIR)/runtime.h $(PREFIX)/include/glacier + install $(IDIR)/security.h $(PREFIX)/include/glacier + +install: install_lib install_head + @echo "[INFO]" + @echo "[INFO] Finished installing library and header files to PREFIX." + @echo "[INFO]" clean: - rm -rf build + rm -rf $(BDIR) diff --git a/VERSION b/VERSION index 08fd861..d8cfec1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.3-rc +0.1.0-rc diff --git a/config.h b/settings.h similarity index 100% rename from config.h rename to settings.h diff --git a/src/config.h b/src/config.h new file mode 100644 index 0000000..5de7fab --- /dev/null +++ b/src/config.h @@ -0,0 +1,27 @@ +/* + * config.h - Various compile-time settings for libglacier + * + * This file is part of Glacier. + * + * Glacier is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Glacier. If + * not, see . + */ + +#ifndef CONFIG_H_ +#define CONFIG_H_ + +/* LG_VERBOSE - whether to use verbose logging for library events or not + * + * 0 is false, 1 is true + */ +#define LG_VERBOSE 0 + +#endif diff --git a/libglacier.c b/src/libglacier.c similarity index 99% rename from libglacier.c rename to src/libglacier.c index 1493f7d..94b219f 100644 --- a/libglacier.c +++ b/src/libglacier.c @@ -31,7 +31,6 @@ #include #include "config.h" -#include "include/globals.h" #define BUFFER_SIZE 1024 #define MAX_CHILDREN 64