81 lines
2.2 KiB
Makefile
81 lines
2.2 KiB
Makefile
include config.mk
|
|
|
|
.PHONY: all prepare log log_test rt pkg istoreutils make_conf dag install clean static libglacier.a install_static
|
|
|
|
all: prepare log log_test rt pkg istoreutils make_conf dag
|
|
@echo "libglacier-ng has finished building"
|
|
|
|
static: prepare log_static pkg_static istoreutils_static libglacier.a
|
|
|
|
log_static:
|
|
$(CC) $(CFLAGS) -c src/log.c -o build/lib/tmp/log.o
|
|
|
|
pkg_static:
|
|
$(CC) $(CFLAGS) -c src/pkg.c -o build/lib/tmp/pkg.o
|
|
|
|
istoreutils_static: pkg_static
|
|
$(CC) $(CFLAGS) -c src/istoreutils.c -o build/lib/tmp/istoreutils.o
|
|
|
|
libglacier.a:
|
|
ar rcs build/lib/libglacier.a \
|
|
build/lib/tmp/log.o \
|
|
build/lib/tmp/pkg.o \
|
|
build/lib/tmp/istoreutils.o
|
|
|
|
prepare:
|
|
mkdir -p build
|
|
mkdir -p build/lib
|
|
mkdir -p build/include
|
|
mkdir -p build/lib/tmp
|
|
mkdir -p build/lib/shared
|
|
mkdir -p build/include/glacier
|
|
|
|
log:
|
|
$(CC) $(CFLAGS) src/log.c -c -o build/lib/tmp/log.o
|
|
cp src/log.h build/include/glacier/log.h
|
|
|
|
log_test:
|
|
$(CC) $(CFLAGS) -shared -fPIC src/log.c -o build/lib/shared/libglacier_log.so
|
|
|
|
rt:
|
|
$(CC) $(CFLAGS) src/runtime.c -c -o build/lib/tmp/runtime.o
|
|
|
|
istoreutils: pkg
|
|
$(CC) $(CFLAGS) -shared -fPIC src/istoreutils.c \
|
|
-Lbuild/lib/shared -lglacier_log -lglacier_pkg -larchive \
|
|
-Wl,-rpath,'$$ORIGIN' \
|
|
-o build/lib/shared/libglacier_istoreutils.so
|
|
|
|
pkg:
|
|
$(CC) $(CFLAGS) -shared -fPIC src/pkg.c \
|
|
-Lbuild/lib/shared -lglacier_log -lconfig \
|
|
-Wl,-rpath,'$$ORIGIN' \
|
|
-o build/lib/shared/libglacier_pkg.so
|
|
|
|
make_conf:
|
|
$(CC) $(CFLAGS) src/make_conf.c -c -o build/lib/tmp/make_conf.o
|
|
|
|
dag:
|
|
$(CC) $(CFLAGS) -shared -fPIC src/dag.c \
|
|
-Lbuild/lib/shared -lglacier_log \
|
|
-Wl,-rpath,'$$ORIGIN' \
|
|
-o build/lib/shared/libglacier_dag.so
|
|
|
|
install:
|
|
mkdir -p $(PREFIX)/lib/glacier/
|
|
install build/lib/shared/libglacier_log.so $(PREFIX)/lib/glacier/ -m 755
|
|
install build/lib/shared/libglacier_istoreutils.so $(PREFIX)/lib/glacier/ -m 755
|
|
install build/lib/shared/libglacier_pkg.so $(PREFIX)/lib/glacier -m 755
|
|
install build/lib/shared/libglacier_dag.so $(PREFIX)/lib/glacier -m 755
|
|
|
|
install_static:
|
|
mkdir -p $(PREFIX)/lib/glacier
|
|
install build/lib/libglacier.a $(PREFIX)/lib/glacier/ -m 644
|
|
|
|
install_test_dir:
|
|
install build/lib/shared/lg_log.so $(TEST_DIR)
|
|
install build/lib/shared/
|
|
|
|
clean:
|
|
rm -rf build
|