diff --git a/.gitignore b/.gitignore index fb9296e..3e14259 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.swp *.d *.o +*.a /apfsck/apfsck /mkapfs/mkapfs /tags diff --git a/apfsck/Makefile b/apfsck/Makefile index 5c50e90..e6d6f84 100644 --- a/apfsck/Makefile +++ b/apfsck/Makefile @@ -4,7 +4,7 @@ OBJS = $(SRCS:.c=.o) DEPS = $(SRCS:.c=.d) LIBDIR = ../lib -LIBS = $(LIBDIR)/checksum.o $(LIBDIR)/unicode.o +LIBRARY = $(LIBDIR)/libapfs.a BINDIR = ~/bin MANDIR = ~/share/man/man8 @@ -13,13 +13,13 @@ SPARSE_VERSION := $(shell sparse --version 2>/dev/null) override CFLAGS += -Wall -I$(CURDIR)/../include -apfsck: $(OBJS) libraries +apfsck: $(OBJS) $(LIBRARY) @echo ' Linking...' - @gcc $(CFLAGS) -o apfsck $(OBJS) $(LIBS) + @gcc $(CFLAGS) -o apfsck $(OBJS) $(LIBRARY) @echo ' Build complete' # Build the common libraries -libraries: FORCE +$(LIBRARY): FORCE @echo ' Building libraries...' @$(MAKE) -C $(LIBDIR) --silent --no-print-directory @echo ' Library build complete' diff --git a/lib/Makefile b/lib/Makefile index e3c3f01..3fc4269 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -6,7 +6,9 @@ SPARSE_VERSION := $(shell sparse --version 2>/dev/null) override CFLAGS += -Wall -I$(CURDIR)/../include -all: $(OBJS) +libapfs.a: $(OBJS) + @echo ' Assembling library archive...' + @ar rcs $@ $^ %.o: %.c @echo ' Compiling $<...' @@ -18,4 +20,4 @@ endif -include $(DEPS) clean: - rm -f $(OBJS) $(DEPS) + rm -f $(OBJS) $(DEPS) libapfs.a