-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
73 lines (55 loc) · 1.64 KB
/
Makefile.in
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
# configure basic variables
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sysconfdir = @sysconfdir@
# basic programs
CC = @CC@
INSTALL = @INSTALL@
MKDIR_P = @MKDIR_P@
# basic variables
DEFINES = @DEFS@ -DDP_CONFIG="\"$(sysconfdir)\""
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
# mysql
MYSQL_CFLAGS = @MYSQL_CFLAGS@
MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ @MYSQL_RPATH@ @MYSQL_LIBS@
# gearman
GEARMAN_CFLAGS = @GEARMAN_CFLAGS@
GEARMAN_LDFLAGS = @GEARMAN_LDFLAGS@ @GEARMAN_RPATH@ @GEARMAN_LIBS@
# yaml
YAML_CFLAGS = @YAML_CFLAGS@
YAML_LDFLAGS = @YAML_LDFLAGS@ @YAML_RPATH@ @YAML_LIBS@
SOURCE = dispatcher.c
HEADER = dispatcher.h global.h
OBJECT = dispatcher.o
TEST_SOURCE = test.c
TEST_OBJECT = test.o
# setup final compiler flags
CFLAGS_REAL = ${DEFINES} $(CFLAGS) $(MYSQL_CFLAGS) $(GEARMAN_CFLAGS) $(YAML_CFLAGS)
LDFLAGS_REAL = $(LDFLAGS) $(MYSQL_LDFLAGS) $(GEARMAN_LDFLAGS) $(YAML_LDFLAGS)
all: dispatcher
test: test_run
$(RUN) ./test_run
$(OBJECT): $(SOURCE) $(HEADER)
$(CC) $(CFLAGS_REAL) -c $*.c -o $*.o
$(TEST_OBJECT): $(OBJECT) $(TEST_SOURCE) $(HEADER)
$(CC) $(CFLAGS_REAL) -c $*.c -o $*.o
dispatcher: $(OBJECT)
$(CC) $(OBJECT) $(LDFLAGS_REAL) -o dispatcher
test_run: $(TEST_OBJECT)
$(CC) $(TEST_OBJECT) $(OBJECT) $(LDFLAGS_REAL) -Wl,-zmuldefs -o test_run
clean:
rm -f dispatcher test
rm -f $(OBJECT) $(TEST_OBJECT)
distclean: clean
rm -f config.h
rm -f config.status config.log
rm -rf .deps
rm -f Makefile
install:
$(MKDIR_P) $(DESTDIR)$(bindir)
$(INSTALL) -m 755 dispatcher $(DESTDIR)$(bindir)
$(MKDIR_P) $(DESTDIR)$(sysconfdir)
$(INSTALL) -m 644 dispatcher.conf $(DESTDIR)$(sysconfdir)
.PHONY: all test clean distclean install