diff --git a/.gitignore b/.gitignore index 7ea8681..30594a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.a *.o *.d /iast diff --git a/Makefile.in b/Makefile.in index 603a390..d9eb42d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,9 @@ PROGNAME = @PROGNAME@ +LIBNAME = lib@PROGNAME@ +ANAME = $(LIBNAME).a CC = @CC@ +AR = @AR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -9,6 +12,7 @@ MKDIR_P = @MKDIR_P@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ +libdir = @libdir@ datarootdir = @datarootdir@ mandir = @mandir@ @@ -32,9 +36,12 @@ all: $(PROGNAME) tests/test $(PROGNAME).1.gz include $(wildcard *.d tests/*.d) -$(PROGNAME): main.o $(OBJECTS) +$(PROGNAME): main.o $(ANAME) $(QUIET_LD) $(CC) $^ -o $@ $(LFLAGS) +$(ANAME): $(OBJECTS) + $(QUIET_AR) $(AR) rcs $@ $^ + test: all tests/test @@ -51,17 +58,19 @@ tests/test: $(OBJECTS) $(TEST_OBJECTS) $(QUIET_GEN) cat $< | gzip -f >$@ install: - $(MKDIR_P) $(bindir) $(mandir)/man1 + $(MKDIR_P) $(bindir) $(libdir) $(mandir)/man1 $(INSTALL_PROGRAM) $(PROGNAME) $(bindir) + $(INSTALL_DATA) $(ANAME) $(libdir) $(INSTALL_DATA) $(PROGNAME).1.gz $(mandir)/man1 uninstall: $(RM) $(bindir)/$(PROGNAME) + $(RM) $(libdir)/$(ANAME) $(RM) $(mandir)/man1/$(PROGNAME).1.gz clean: $(RM) $(PROGNAME) tests/test $(PROGNAME).1.gz - $(RM) -r *.o */*.o */*.d *.d *.gcda *.gcno tests/coverage + $(RM) -r *.a *.o */*.o */*.d *.d *.gcda *.gcno tests/coverage clean-aux: $(RM) -r $(AUX_FILES) @@ -81,5 +90,6 @@ endif ifndef V QUIET_CC = @echo " CC $@"; QUIET_LD = @echo " CCLD $@"; +QUIET_AR = @echo " AR $@"; QUIET_GEN = @echo " GEN $@"; endif diff --git a/configure.ac b/configure.ac index 488d07d..dd9e2ac 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,7 @@ AC_DEFINE_UNQUOTED([PROGNAME], ["$PROGNAME"], [Name of the target binary]) AC_PROG_CC AC_PROG_MKDIR_P AC_PROG_INSTALL +AC_CHECK_TOOL([AR], [ar]) # Checks for libraries. PKG_CHECK_MODULES(CHECK, check)