debian/0000755000000000000000000000000011541411573007170 5ustar debian/changelog0000644000000000000000000000023111541407432011035 0ustar cliquer (1.21-1) unstable; urgency=low * Initial release (Closes: 617947). -- Bernhard R. Link Sun, 20 Mar 2011 12:35:35 +0100 debian/cliquer.10000644000000000000000000000656411541411475010732 0ustar .TH CLIQUER 1 "2011-03-14" "cliquer" CLIQUER .SH NAME cliquer \- find cliques in weighted and unweighted graphs. .SH SYNOPSIS .B cliquer \-\-help .B cliquer [ \fIoptions\fP ] \fIgraph-filename\fP .SH DESCRIPTION .B cliquer searched for cliques in a graph. The graph is read from the file given as command line argument, or \fBstdin\fP if that filename is "\fB\-\fP". The file must be ASCII as described below or a binary DIMACS-format. By default it prints the first maximal clique it finds, but this can be changed with the options described below. .SH OPTIONS .TP .B \-h \-\-help Displays a short list of options and what they do. .TP .B \-a \-\-all Find all cliques. .TP .B \-s \-\-single Find only one clique (default). .TP .B \-w \-\-weight Tell only maximum weight (no faster than \fB\-s\fP). .TP .B \-m \fIN\fP \-\-min \fIN\fP Search for cliques with weight at least \fIN\fP. If \fIN\fP=0, searches for maximum weight clique (default). .TP .B \-M \fIN\fP \-\-max \fIN\fP Search for cliques with weight at most \fIN\fP. If \fIN\fP=0, no limit is imposed (default). \fIN\fP being positive is incompatible with "\fB\-\-min 0\fP" ("\fB\-\-min 1\fP" is assumed). .TP .B \-x \-\-maximal Require cliques to be maximal. .TP .B \-u \-\-unweighted Assume weight 1 for all vertices. .TP .B \-0 \-\-from\-0 Number vertices 0 to n\-1 instead of 1 to n when writing. .TP .B \-q \-\-quiet Suppresses progress output. Specifying \fB\-q\fP twice suppresses all output except the actual result. .TP .B \-r \fIF\fP \-\-reorder \fIF\fP Reorder with function \fIF\fP. Available reordering functions are: .RS .TP .B none No ordering (same order as in the file). .TP .B reverse Reverse order as in the file. .TP .B default One of the two below, depending on weightedness. .TP .B unweighted\-coloring Coloring method efficient for unweighted graphs. .TP .B weighted\-coloring Coloring method efficient for weighted graphs. .TP .B degree Order by ascending degree. .TP .B random Random order. .RE .SH "FILE FORMAT" The format of the ASCII representation of a graph is the following: Each line has a single letter (enclosed in spaces) as first part. A line with '\fBp\fP' starts the graph. The second token is a name of at most 15 characters and ignored. Then there is the number of nodes in this graph. Then the number of edges (currently ignored). A line with '\fBe\fP' adds an edge. The two next tokens are the numbers of two nodes to connect. A line with '\fBn\fP' weights an node. The first argument is the number of the node to assign a weight to, the second it's weight. .SH "EXAMPLE" p clausehouse 5 8 e 4 3 e 3 1 e 1 2 e 2 3 e 3 5 e 5 2 e 2 4 e 4 5 n 1 2 .SH COPYRIGHT Cliquer is Copyright \(co 2002 Sampo Niskanen, Patric Ostergard Cliquer is licensed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The full license is included in the file LICENSE. Basically, you can use Cliquer for any purpose, provided that any programs or modifications you make and distribute are also licensed under the GNU GPL. ABSOLUTELY NO GUARANTEES OR WARRANTIES are made concerning the suitability, correctness, or any other aspect of these routines. This manpage is based on text from the cliquer program with the obove copyright and license with modification Copyright \(co 2011 Bernhard R. Link, also available under above license. debian/cliquer.docs0000644000000000000000000000000711541407432011502 0ustar README debian/cliquer.examples0000644000000000000000000000006511541407432012374 0ustar testcase-large-w.b testcase-large.b testcase-small.a debian/cliquer.install0000644000000000000000000000001211541407432012214 0ustar usr/bin/* debian/cliquer.manpages0000644000000000000000000000002111541407432012341 0ustar debian/cliquer.1 debian/compat0000644000000000000000000000000211541407432010365 0ustar 7 debian/control0000644000000000000000000000271311541407432010575 0ustar Source: cliquer Section: science Priority: optional Maintainer: Debian Science Maintainers Uploaders: Bernhard R. Link Build-Depends: dpkg-dev (>= 1.15.7~), debhelper (>= 7) Standards-Version: 3.9.1 Vcs-Browser: http://git.debian.org/?p=debian-science/packages/cliquer.git Vcs-Git: git://git.debian.org/git/debian-science/packages/cliquer.git Homepage: http://www.tkk.fi/~pat/cliquer.html Package: cliquer Section: math Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: clique searching program Cliquer search for cliques in arbitrary weighted and unweighted graphs. It can search for maximal cliques, maximal-weighted cliques or cliques within a given size range. Package: libcliquer-dev Section: libdevel Architecture: any Depends: libcliquer1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Description: clique searching library (development headers) This package contains the development headers for the clique searching library found in libcliquer0, which allows searching for cliques in arbitrary weighted and unweighted graphs. Package: libcliquer1 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: clique searching library Cliquer is a set of routines for finding cliques in arbitrary weighted and unweighted graphs. It can search for maximal cliques, maximal-weighted cliques or cliques within a given size range. debian/copyright0000644000000000000000000000231511541407432011123 0ustar Files: debian/* Author: Bernhard R. Link Copyright: Copyright 2011 Bernhard R. Link License: GPL-2+ The Debian packaging is licensed under the GPL, version 2 or later. Files: * Author: Sampo Niskanen . Copyright: Copyright (C) 2002 Sampo Niskanen, Patric Ostergard. License: GPL-2+ Cliquer is licensed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The full license is included in the file LICENSE. Basically, you can use Cliquer for any purpose, provided that any programs or modifications you make and distribute are also licensed under the GNU GPL. ABSOLUTELY NO GUARANTEES OR WARRANTIES are made concerning the suitability, correctness, or any other aspect of these routines. Files: sage.c Copyright: Copyright (C) 2002 Sampo Niskanen, Patric Östergård. Copyright (C) Nathann Cohen, Mike Hansen, Peter Jeremy. Karl-Dieter Crisman, Georg S. Weber and/or Minh Van Nguyen Copyright (C) 2011 Bernhard R. Link License: GPL-2+ On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2 debian/libcliquer-dev.docs0000644000000000000000000000000711541407432012745 0ustar README debian/libcliquer-dev.install0000644000000000000000000000005411541407432013465 0ustar usr/include/cliquer/* usr/lib/libcliquer.so debian/libcliquer1.install0000644000000000000000000000003011541407432012764 0ustar usr/lib/libcliquer.so.* debian/libcliquer1.symbols0000644000000000000000000000006411541411107013007 0ustar libcliquer.so.1 libcliquer1 #MINVER# *@CLIQUER_1 0 debian/patches/0000755000000000000000000000000011541407432010616 5ustar debian/patches/0001-make-local-function-in-cl.c-static.patch0000644000000000000000000000613511541407432020560 0ustar From 1f5b9b32eb955c01135f484120cf5d68e25ba5e8 Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 12 Mar 2011 15:09:47 +0100 Subject: make local function in cl.c static --- cl.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cl.c b/cl.c index e929565..9005f1f 100644 --- a/cl.c +++ b/cl.c @@ -12,12 +12,12 @@ #define TRYFORHELP "Try `%s -h' for more information.\n",argv[0] -void printhelp(char *prog); -void read_options(int argc, char **argv); -void print_search(graph_t *g); -boolean record_clique_func(set_t s,graph_t *g,clique_options *opts); -boolean print_clique_func(set_t s,graph_t *g,clique_options *opts); -void print_clique(set_t s,graph_t *g); +static void printhelp(char *prog); +static void read_options(int argc, char **argv); +static void print_search(graph_t *g); +static boolean record_clique_func(set_t s,graph_t *g,clique_options *opts); +static boolean print_clique_func(set_t s,graph_t *g,clique_options *opts); +static void print_clique(set_t s,graph_t *g); /* Options, changed by command-line arguments. */ @@ -144,7 +144,7 @@ int main(int argc, char **argv) { * Prints the help message to stdout. prog is the program name * (from argv[0]). */ -void printhelp(char *prog) { +static void printhelp(char *prog) { printf("Usage: %s [options] \n" "\n" " is the ASCII or binary DIMACS-format file from which to read\n" @@ -187,7 +187,7 @@ void printhelp(char *prog) { /* * Reads the command-line options and sets the global options accordingly. */ -void read_options(int argc, char **argv) { +static void read_options(int argc, char **argv) { int c; char *ptr; @@ -337,7 +337,7 @@ void read_options(int argc, char **argv) { /* * Prints a line to stderr indicating what is being searched for. */ -void print_search(graph_t *g) { +static void print_search(graph_t *g) { fprintf(stderr,"Searching for %s ",find_all?"all":"a single"); if (min_weight==0) { fprintf(stderr,"maximum %s clique%s...\n", @@ -362,7 +362,7 @@ void print_search(graph_t *g) { /* * Prints the clique s along with it's size and weight. */ -void print_clique(set_t s,graph_t *g) { +static void print_clique(set_t s,graph_t *g) { int i; printf("size=%d, weight=%d: ",set_size(s),graph_subgraph_weight(g,s)); @@ -382,7 +382,7 @@ void print_clique(set_t s,graph_t *g) { * Records a clique into the clique list using dynamic allocation. * Used as opts->user_function. */ -boolean record_clique_func(set_t s,graph_t *g,clique_options *opts) { +static boolean record_clique_func(set_t s,graph_t *g,clique_options *opts) { if (clique_count>=clique_list_size) { clique_list=realloc(clique_list,(clique_list_size+512) * sizeof(set_t)); @@ -396,7 +396,7 @@ boolean record_clique_func(set_t s,graph_t *g,clique_options *opts) { /* * Prints a clique. Used as opts->user_function. */ -boolean print_clique_func(set_t s,graph_t *g,clique_options *opts) { +static boolean print_clique_func(set_t s,graph_t *g,clique_options *opts) { print_clique(s,g); return TRUE; } -- 1.5.6.5 debian/patches/0002-build-shared-library.patch0000644000000000000000000002217411541407432016231 0ustar From 55e3d1793c037355b87a4fc5b46b38460213012a Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 12 Mar 2011 16:06:39 +0100 Subject: build shared library --- Makefile | 24 ++++++++++++++++++++---- cliquer.h | 18 +++++++++--------- graph.h | 30 +++++++++++++++--------------- libcliquer.map | 43 +++++++++++++++++++++++++++++++++++++++++++ misc.h | 7 +++++++ reorder.h | 28 ++++++++++++++-------------- 6 files changed, 108 insertions(+), 42 deletions(-) create mode 100644 libcliquer.map diff --git a/Makefile b/Makefile index 6c5de54..da7fb79 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,14 @@ CFLAGS=-Wall -O3 -fomit-frame-pointer -funroll-loops # SunOS: #CFLAGS=-fast +# GCC: +SHLDFLAGS = --shared -Wl,--soname=libcliquer.so.1 -Wl,--version-script=libcliquer.map +SHCFLAGS = -fPIC -fvisibility=hidden + +# SunOS: +#SHLDFLAGS = --shared -Wl,--soname=libcliquer.so.1 -Wl,--version-script=libcliquer.map +#SHCFLAGS = -fPIC + ## Program options: # Enable long options for cl (eg. "cl --help"), comment out to disable. @@ -29,14 +37,19 @@ LONGOPTS = -DENABLE_LONG_OPTIONS ##### End of configurable options -all: cl +all: cl libcliquer.so + +libcliquer_OBJECTS = cliquer.o graph.o reorder.o testcases: testcases.o cliquer.o graph.o reorder.o $(CC) $(LDFLAGS) -o $@ testcases.o cliquer.o graph.o reorder.o -cl: cl.o cliquer.o graph.o reorder.o - $(CC) $(LDFLAGS) -o $@ cl.o cliquer.o graph.o reorder.o +libcliquer.so: $(libcliquer_OBJECTS) libcliquer.map + $(CC) $(LDFLAGS) $(SHCFLAGS) $(SHLDFLAGS) -o $@ $(libcliquer_OBJECTS) + +cl: cl.o libcliquer.so + $(CC) $(LDFLAGS) -o $@ cl.o -L. -lcliquer cl.o testcases.o cliquer.o graph.o reorder.o: cliquer.h set.h graph.h misc.h reorder.h Makefile cliquerconf.h @@ -44,8 +57,11 @@ cl.o testcases.o cliquer.o graph.o reorder.o: cliquer.h set.h graph.h misc.h reo cl.o: cl.c $(CC) $(CFLAGS) $(LONGOPTS) -o $@ -c $< +$(libcliquer_OBJECTS): %.o: %.c + $(CC) $(CFLAGS) $(SHCFLAGS) $(LONGOPTS) -o $@ -c $< + clean: - rm -f *.o *~ cl testcases + rm -f *.o *~ cl testcases *.so* backup: mkdir "`date "+backup-%Y-%m-%d-%H-%M"`" 2>/dev/null || true diff --git a/cliquer.h b/cliquer.h index d9993be..aa7fafb 100644 --- a/cliquer.h +++ b/cliquer.h @@ -24,29 +24,29 @@ struct _clique_options { int clique_list_length; }; -extern clique_options *clique_default_options; +PUBLIC clique_options *clique_default_options; /* Weighted clique functions */ -extern int clique_max_weight(graph_t *g,clique_options *opts); -extern set_t clique_find_single(graph_t *g,int min_weight,int max_weight, +PUBLIC int clique_max_weight(graph_t *g,clique_options *opts); +PUBLIC set_t clique_find_single(graph_t *g,int min_weight,int max_weight, boolean maximal, clique_options *opts); -extern int clique_find_all(graph_t *g, int req_weight, boolean exact, +PUBLIC int clique_find_all(graph_t *g, int req_weight, boolean exact, boolean maximal, clique_options *opts); /* Unweighted clique functions */ #define clique_unweighted_max_size clique_unweighted_max_weight -extern int clique_unweighted_max_weight(graph_t *g, clique_options *opts); -extern set_t clique_unweighted_find_single(graph_t *g,int min_size, +PUBLIC int clique_unweighted_max_weight(graph_t *g, clique_options *opts); +PUBLIC set_t clique_unweighted_find_single(graph_t *g,int min_size, int max_size,boolean maximal, clique_options *opts); -extern int clique_unweighted_find_all(graph_t *g, int min_size, int max_size, +PUBLIC int clique_unweighted_find_all(graph_t *g, int min_size, int max_size, boolean maximal, clique_options *opts); /* Time printing functions */ -extern boolean clique_print_time(int level, int i, int n, int max, +PUBLIC boolean clique_print_time(int level, int i, int n, int max, double cputime, double realtime, clique_options *opts); -extern boolean clique_print_time_always(int level, int i, int n, int max, +PUBLIC boolean clique_print_time_always(int level, int i, int n, int max, double cputime, double realtime, clique_options *opts); diff --git a/graph.h b/graph.h index 9c94f17..8701b28 100644 --- a/graph.h +++ b/graph.h @@ -25,26 +25,26 @@ struct _graph_t { } while (FALSE) -extern graph_t *graph_new(int n); -extern void graph_free(graph_t *g); -extern void graph_resize(graph_t *g, int size); -extern void graph_crop(graph_t *g); +PUBLIC graph_t *graph_new(int n); +PUBLIC void graph_free(graph_t *g); +PUBLIC void graph_resize(graph_t *g, int size); +PUBLIC void graph_crop(graph_t *g); -extern boolean graph_weighted(graph_t *g); -extern int graph_edge_count(graph_t *g); +PUBLIC boolean graph_weighted(graph_t *g); +PUBLIC int graph_edge_count(graph_t *g); -extern graph_t *graph_read_dimacs(FILE *fp); -extern graph_t *graph_read_dimacs_file(char *file); -extern boolean graph_write_dimacs_ascii(graph_t *g, char *comment,FILE *fp); -extern boolean graph_write_dimacs_ascii_file(graph_t *g,char *comment, +PUBLIC graph_t *graph_read_dimacs(FILE *fp); +PUBLIC graph_t *graph_read_dimacs_file(char *file); +PUBLIC boolean graph_write_dimacs_ascii(graph_t *g, char *comment,FILE *fp); +PUBLIC boolean graph_write_dimacs_ascii_file(graph_t *g,char *comment, char *file); -extern boolean graph_write_dimacs_binary(graph_t *g, char *comment,FILE *fp); -extern boolean graph_write_dimacs_binary_file(graph_t *g, char *comment, +PUBLIC boolean graph_write_dimacs_binary(graph_t *g, char *comment,FILE *fp); +PUBLIC boolean graph_write_dimacs_binary_file(graph_t *g, char *comment, char *file); -extern void graph_print(graph_t *g); -extern boolean graph_test(graph_t *g, FILE *output); -extern int graph_test_regular(graph_t *g); +PUBLIC void graph_print(graph_t *g); +PUBLIC boolean graph_test(graph_t *g, FILE *output); +PUBLIC int graph_test_regular(graph_t *g); UNUSED_FUNCTION INLINE static int graph_subgraph_weight(graph_t *g,set_t s) { diff --git a/libcliquer.map b/libcliquer.map new file mode 100644 index 0000000..5650839 --- /dev/null +++ b/libcliquer.map @@ -0,0 +1,43 @@ +CLIQUER_1 { + global: + clique_default_options; + clique_max_weight; + clique_find_single; + clique_find_all; + clique_unweighted_max_weight; + clique_unweighted_find_single; + clique_unweighted_find_all; + clique_print_time; + clique_print_time_always; + graph_new; + graph_free; + graph_resize; + graph_crop; + graph_weighted; + graph_edge_count; + graph_read_dimacs; + graph_read_dimacs_file; + graph_write_dimacs_ascii; + graph_write_dimacs_ascii_file; + graph_write_dimacs_binary; + graph_write_dimacs_binary_file; + graph_print; + graph_test; + graph_test_regular; + reorder_set; + reorder_graph; + reorder_duplicate; + reorder_invert; + reorder_reverse; + reorder_ident; + reorder_is_bijection; + reorder_by_greedy_coloring; + reorder_by_weighted_greedy_coloring; + reorder_by_unweighted_greedy_coloring; + reorder_by_degree; + reorder_by_random; + reorder_by_ident; + reorder_by_reverse; + local: + *; +}; diff --git a/misc.h b/misc.h index 9cad635..60f8349 100644 --- a/misc.h +++ b/misc.h @@ -26,6 +26,13 @@ # endif #endif /* !UNUSED_FUNCTION */ +#ifndef PUBLIC +# if __GNUC__ >= 4 +# define PUBLIC extern __attribute__ ((visibility("default"))) +# else +# define PUBLIC extern +# endif +#endif /* * Default inlining directive: "inline" diff --git a/reorder.h b/reorder.h index 5c06d31..1d3b4e1 100644 --- a/reorder.h +++ b/reorder.h @@ -5,22 +5,22 @@ #include "set.h" #include "graph.h" -extern void reorder_set(set_t s,int *order); -extern void reorder_graph(graph_t *g, int *order); -extern int *reorder_duplicate(int *order,int n); -extern void reorder_invert(int *order,int n); -extern void reorder_reverse(int *order,int n); -extern int *reorder_ident(int n); -extern boolean reorder_is_bijection(int *order,int n); +PUBLIC void reorder_set(set_t s,int *order); +PUBLIC void reorder_graph(graph_t *g, int *order); +PUBLIC int *reorder_duplicate(int *order,int n); +PUBLIC void reorder_invert(int *order,int n); +PUBLIC void reorder_reverse(int *order,int n); +PUBLIC int *reorder_ident(int n); +PUBLIC boolean reorder_is_bijection(int *order,int n); #define reorder_by_default reorder_by_greedy_coloring -extern int *reorder_by_greedy_coloring(graph_t *g, boolean weighted); -extern int *reorder_by_weighted_greedy_coloring(graph_t *g, boolean weighted); -extern int *reorder_by_unweighted_greedy_coloring(graph_t *g,boolean weighted); -extern int *reorder_by_degree(graph_t *g, boolean weighted); -extern int *reorder_by_random(graph_t *g, boolean weighted); -extern int *reorder_by_ident(graph_t *g, boolean weighted); -extern int *reorder_by_reverse(graph_t *g, boolean weighted); +PUBLIC int *reorder_by_greedy_coloring(graph_t *g, boolean weighted); +PUBLIC int *reorder_by_weighted_greedy_coloring(graph_t *g, boolean weighted); +PUBLIC int *reorder_by_unweighted_greedy_coloring(graph_t *g,boolean weighted); +PUBLIC int *reorder_by_degree(graph_t *g, boolean weighted); +PUBLIC int *reorder_by_random(graph_t *g, boolean weighted); +PUBLIC int *reorder_by_ident(graph_t *g, boolean weighted); +PUBLIC int *reorder_by_reverse(graph_t *g, boolean weighted); #endif /* !CLIQUER_REORDER_H */ -- 1.5.6.5 debian/patches/0003-rename-cl-binary-to-cliquer.patch0000644000000000000000000000265011541407432017431 0ustar From ba9976cd6e00f831e6bb104b275ae63998a6a6d0 Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 12 Mar 2011 16:16:39 +0100 Subject: rename cl binary to cliquer --- Makefile | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index da7fb79..8620a22 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ SHCFLAGS = -fPIC -fvisibility=hidden ## Program options: -# Enable long options for cl (eg. "cl --help"), comment out to disable. +# Enable long options for cliquer (eg. "cliquer --help"), comment out to disable. # Requires getopt_long(3) (a GNU extension) LONGOPTS = -DENABLE_LONG_OPTIONS @@ -37,7 +37,7 @@ LONGOPTS = -DENABLE_LONG_OPTIONS ##### End of configurable options -all: cl libcliquer.so +all: cliquer libcliquer.so libcliquer_OBJECTS = cliquer.o graph.o reorder.o @@ -48,7 +48,7 @@ testcases: testcases.o cliquer.o graph.o reorder.o libcliquer.so: $(libcliquer_OBJECTS) libcliquer.map $(CC) $(LDFLAGS) $(SHCFLAGS) $(SHLDFLAGS) -o $@ $(libcliquer_OBJECTS) -cl: cl.o libcliquer.so +cliquer: cl.o libcliquer.so $(CC) $(LDFLAGS) -o $@ cl.o -L. -lcliquer @@ -61,7 +61,7 @@ $(libcliquer_OBJECTS): %.o: %.c $(CC) $(CFLAGS) $(SHCFLAGS) $(LONGOPTS) -o $@ -c $< clean: - rm -f *.o *~ cl testcases *.so* + rm -f *.o *~ cliquer testcases *.so* backup: mkdir "`date "+backup-%Y-%m-%d-%H-%M"`" 2>/dev/null || true -- 1.5.6.5 debian/patches/0004-more-usual-flags-usage.patch0000644000000000000000000000343711541407432016514 0ustar From 0ee4a33d27ab261ae343338a6ca3f3c0d732e908 Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 12 Mar 2011 16:22:41 +0100 Subject: more usual flags usage Always give CFLAGS to the linker, always CPPFLAGS to the compiler. --- Makefile | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8620a22..89ebbe8 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,8 @@ SHCFLAGS = -fPIC -fvisibility=hidden #SHLDFLAGS = --shared -Wl,--soname=libcliquer.so.1 -Wl,--version-script=libcliquer.map #SHCFLAGS = -fPIC +CPPFLAGS = + ## Program options: # Enable long options for cliquer (eg. "cliquer --help"), comment out to disable. @@ -43,22 +45,25 @@ libcliquer_OBJECTS = cliquer.o graph.o reorder.o testcases: testcases.o cliquer.o graph.o reorder.o - $(CC) $(LDFLAGS) -o $@ testcases.o cliquer.o graph.o reorder.o + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ testcases.o cliquer.o graph.o reorder.o libcliquer.so: $(libcliquer_OBJECTS) libcliquer.map - $(CC) $(LDFLAGS) $(SHCFLAGS) $(SHLDFLAGS) -o $@ $(libcliquer_OBJECTS) + $(CC) $(CFLAGS) $(LDFLAGS) $(SHCFLAGS) $(SHLDFLAGS) -o $@ $(libcliquer_OBJECTS) cliquer: cl.o libcliquer.so - $(CC) $(LDFLAGS) -o $@ cl.o -L. -lcliquer + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cl.o -L. -lcliquer cl.o testcases.o cliquer.o graph.o reorder.o: cliquer.h set.h graph.h misc.h reorder.h Makefile cliquerconf.h cl.o: cl.c - $(CC) $(CFLAGS) $(LONGOPTS) -o $@ -c $< + $(CC) $(CPPFLAGS) $(CFLAGS) $(LONGOPTS) -o $@ -c $< $(libcliquer_OBJECTS): %.o: %.c - $(CC) $(CFLAGS) $(SHCFLAGS) $(LONGOPTS) -o $@ -c $< + $(CC) $(CPPFLAGS) $(CFLAGS) $(SHCFLAGS) -o $@ -c $< + +testcases.o: testcases.c + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< clean: rm -f *.o *~ cliquer testcases *.so* -- 1.5.6.5 debian/patches/0005-add-install-target.patch0000644000000000000000000000344511541407432015707 0ustar From d62c750da74ed839b57719fdeb340ecf7bccec9f Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 12 Mar 2011 17:11:13 +0100 Subject: add install target --- Makefile | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 89ebbe8..b60e992 100644 --- a/Makefile +++ b/Makefile @@ -20,11 +20,11 @@ CFLAGS=-Wall -O3 -fomit-frame-pointer -funroll-loops #CFLAGS=-fast # GCC: -SHLDFLAGS = --shared -Wl,--soname=libcliquer.so.1 -Wl,--version-script=libcliquer.map +SHLDFLAGS = --shared -Wl,--soname=$(SONAME) -Wl,--version-script=libcliquer.map SHCFLAGS = -fPIC -fvisibility=hidden # SunOS: -#SHLDFLAGS = --shared -Wl,--soname=libcliquer.so.1 -Wl,--version-script=libcliquer.map +#SHLDFLAGS = --shared -Wl,--soname=$(SONAME) -Wl,--version-script=libcliquer.map #SHCFLAGS = -fPIC CPPFLAGS = @@ -42,7 +42,7 @@ LONGOPTS = -DENABLE_LONG_OPTIONS all: cliquer libcliquer.so libcliquer_OBJECTS = cliquer.o graph.o reorder.o - +SONAME=libcliquer.so.1 testcases: testcases.o cliquer.o graph.o reorder.o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ testcases.o cliquer.o graph.o reorder.o @@ -74,3 +74,20 @@ backup: test: testcases ./testcases + +DESTDIR= +INSTALL=install +INSTALL_DATA=$(INSTALL) -m644 +MKDIR_P=mkdir -p +prefix=/usr/local + +install: cliquer libcliquer.so + $(MKDIR_P) $(DESTDIR)$(prefix)/bin + $(MKDIR_P) $(DESTDIR)$(prefix)/lib + $(MKDIR_P) $(DESTDIR)$(prefix)/include/cliquer + $(INSTALL) cliquer $(DESTDIR)$(prefix)/bin/ + $(INSTALL) libcliquer.so $(DESTDIR)$(prefix)/lib/$(SONAME) + ln -s $(SONAME) $(DESTDIR)$(prefix)/lib/libcliquer.so + # users should #include + $(INSTALL_DATA) cliquer.h set.h graph.h misc.h reorder.h \ + cliquerconf.h $(DESTDIR)$(prefix)/include/cliquer/ -- 1.5.6.5 debian/patches/series0000644000000000000000000000026511541407432012036 0ustar 0001-make-local-function-in-cl.c-static.patch 0002-build-shared-library.patch 0003-rename-cl-binary-to-cliquer.patch 0004-more-usual-flags-usage.patch 0005-add-install-target.patch debian/rules0000755000000000000000000000224511541407432010252 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_OPTIONS CFLAGS := $(shell dpkg-buildflags --get CFLAGS) CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) endif CFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith # -Wextra build: build-arch-stamp build-arch: build-arch-stamp build-indep: build-arch-stamp: $(MAKE) CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' prefix=/usr touch $@ clean: $(MAKE) clean rm -f build-arch-stamp dh_clean binary: binary-arch binary-indep binary-indep: binary-arch: build-arch-stamp dh_testdir dh_testroot dh_prep $(MAKE) install prefix=/usr DESTDIR=$(CURDIR)/debian/tmp dh_install dh_installchangelogs dh_installexamples dh_installdocs dh_installman dh_link dh_strip dh_makeshlibs dh_shlibdeps dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb .PHONY: build build-arch build-indep clean binary binary-arch binary-indep debian/source/0000755000000000000000000000000011541407432010467 5ustar debian/source/format0000644000000000000000000000001411541407432011675 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000014311541407432010216 0ustar # See uscan(1) for format version=3 http://users.tkk.fi/pat/cliquer.html .*/cliquer-(.*)\.tar\.gz