1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
# /usr/share/doc/libigraph-dev/examples/simple/Makefile
#
# Ad hoc Makefile for building and playing with the sample sources
# distributed within the debian package libigraph-examples.
#
# Recommended usage:
# create a dedicated folder somewhere in your HOME directory;
# link all the files in /usr/share/doc/libigraph-dev/examples/simple
# in the dedicated folder; launch this Makefile in the dedicated folder:
# $ make
# for a basic cleanup, consider the clean target:
# $ make clean
# for an entire cleanup, the maintainer-clean target:
# $ make maintainer-clean
# for other targets, just read the Makefile.
#
# written for Debian by Jerome Benoit <calculus@rezozer.net>
# on behalf of the Debian Med Packaging Team
# copyright: 2020-2025 Jerome Benoit <calculus@rezozer.net>
# distributed under the terms and conditions of GPL version 2 or later
#
SHELL=/bin/bash
default: all
XPROGRAMS = \
tls1
XOUTPOUTS = \
igraph_power_law_fit.out
PROGRAMS = \
$(patsubst %.c,%,$(wildcard *.c))
RESULTFILES = \
$(addsuffix .res,$(filter-out $(XPROGRAMS),$(PROGRAMS)))
DIFFFILES = \
$(patsubst %.out,%.diff,$(filter-out $(XOUTPOUTS),$(wildcard *.out)))
XDIFFFILES = \
$(patsubst %.out,%.xdiff,$(filter $(XOUTPOUTS),$(wildcard *.out)))
CFLAGS = $(shell pkg-config igraph --cflags)
LDLIBS = $(shell pkg-config igraph --libs) -lm
CFLAGS += -Wall -g
CFLAGS += -O2
CFLAGS += -Wno-maybe-uninitialized
CFLAGS += -Wno-deprecated-declarations
all: build check
build: $(PROGRAMS)
checkclean:
$(RM) $(XDIFFFILES) $(DIFFFILES) $(RESULTFILES)
check-run: $(RESULTFILES)
check-res: $(DIFFFILES) $(XDIFFFILES)
check: checkclean check-run check-res
clean: checkclean
$(RM) $(PROGRAMS)
maintainer-clean: clean
%.res : %
@echo "===8><--- $* ---"
( set -o pipefail ; ./$< 2> >(grep -v '^Warning at' >&2) | tee $@ )
@echo "----------><8==="
@echo
%.xres : %
@echo "===8><--- $* ---"
( set -o pipefail ; ./$< | tee $@ )
@echo "----------><8==="
@echo
%.diff : %.res %.out
@echo "===8><--- $* ---"
( set -o pipefail ; diff -N $^ | tee $@ )
@echo "----------><8==="
@echo
%.xdiff : %.xres %.out
@echo "===8><--- $* ---"
diff -N $^ | tee $@
@echo "----------><8==="
@echo
%.out : %
#### do nothing
.PRECIOUS: %.res %.xres
.NOTPARALLEL:
|