Makefile: compile libiast.a

This commit is contained in:
Vlasta Vesely 2021-05-02 21:30:30 +02:00
parent fdeaf3602b
commit 5a14ecb688
No known key found for this signature in database
GPG key ID: EB0E649DC0DFCC22
3 changed files with 15 additions and 3 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
*.a
*.o
*.d
/iast

View file

@ -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

View file

@ -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)