File: Makefile

package info (click to toggle)
cliquer 1.21-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 484 kB
  • sloc: ansic: 5,394; makefile: 180
file content (93 lines) | stat: -rw-r--r-- 2,329 bytes parent folder | download | duplicates (2)
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

##### Configurable options:

## Compiler:
CC=gcc
#CC=cc

## Compiler flags:

# GCC:  (also -march=pentium etc, for machine-dependent optimizing)
CFLAGS=-Wall -O3 -fomit-frame-pointer -funroll-loops

# GCC w/ debugging:
#CFLAGS=-Wall -g -DINLINE=

# Compaq C / Digital C:
#CFLAGS=-arch=host -fast

# SunOS:
#CFLAGS=-fast

# GCC:
SHLDFLAGS = --shared -Wl,--soname=$(SONAME) -Wl,--version-script=libcliquer.map
SHCFLAGS  = -fPIC -fvisibility=hidden

# SunOS:
#SHLDFLAGS = --shared -Wl,--soname=$(SONAME) -Wl,--version-script=libcliquer.map
#SHCFLAGS  = -fPIC

CPPFLAGS =

## Program options:

# Enable long options for cliquer (eg. "cliquer --help"), comment out to disable.
# Requires getopt_long(3)  (a GNU extension)
LONGOPTS = -DENABLE_LONG_OPTIONS


##### End of configurable 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

libcliquer.so: $(libcliquer_OBJECTS) libcliquer.map
	$(CC) $(CFLAGS) $(LDFLAGS) $(SHCFLAGS) $(SHLDFLAGS) -o $@ $(libcliquer_OBJECTS)

cliquer: cl.o libcliquer.so
	$(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) $(CPPFLAGS) $(CFLAGS) $(LONGOPTS) -o $@ -c $<

$(libcliquer_OBJECTS): %.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHCFLAGS) -o $@ -c $<

testcases.o: testcases.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<

clean:
	rm -f *.o *~ cliquer testcases *.so*

backup:
	mkdir "`date "+backup-%Y-%m-%d-%H-%M"`" 2>/dev/null || true
	cp * "`date "+backup-%Y-%m-%d-%H-%M"`"  2>/dev/null || true

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 <cliquer/cliquer.h>
	$(INSTALL_DATA) cliquer.h set.h graph.h misc.h reorder.h \
		cliquerconf.h $(DESTDIR)$(prefix)/include/cliquer/