8 BINDIR ?
= $(PREFIX
)/bin
9 SHAREDIR ?
= $(PREFIX
)/share
10 MANDIR ?
= $(SHAREDIR
)/man
12 CFLAGS
+= -std
=c99
-D_POSIX_C_SOURCE
=200809L -D_DEFAULT_SOURCE
14 # Do you want logging?
15 CFLAGS
+= -DWRITE_LOGS
=1
17 # fcgi - grumble grumble no pkg-config entry
20 # libmagic - grumble grumble no pkg-config entry
24 CFLAGS
+= $(shell pkg-config
--cflags sqlite3
)
25 LDFLAGS
+= $(shell pkg-config
--libs sqlite3
)
28 CFLAGS
+= $(shell pkg-config
--cflags libpcre2-8
)
29 LDFLAGS
+= $(shell pkg-config
--libs libpcre2-8
)
32 CFLAGS
+= $(shell pkg-config
--cflags libsodium
)
33 LDFLAGS
+= $(shell pkg-config
--libs libsodium
)
35 # gmime - one of these day's I'll do it without fscking glib
36 CFLAGS
+= $(shell pkg-config
--cflags gmime-2.6
)
37 LDFLAGS
+= $(shell pkg-config
--libs gmime-2.6
)
40 # CFLAGS += -g -O0 -pedantic -Wall -Wextra -Werror
42 # The `-O3' makes it go three times faster
43 # CFLAGS += -O3 -pedantic -Wall -Wextra -Werror
45 # If this is `foodb', then you'd better have db-foodb.c ready
68 config.h
: config.def.h
69 cp config.def.h config.h
71 %.o
: %.c config.h rb79.h macros.h unicode-transforms.h
72 $(CC
) $(CFLAGS
) -c
-o
$@
$<
74 rb79-server
: $(SERVER_OFILES
)
75 $(CC
) -o
$@
$^
$(LDFLAGS
)
77 rb79-ban-ip
: db-
$(DB_TYPE
).o locks.o rb79-ban-ip.o util.o \
79 $(CC
) -o
$@
$^
$(LDFLAGS
)
81 rb79-delete-post
: db-
$(DB_TYPE
).o locks.o rb79-delete-post.o util.o \
83 $(CC
) -o
$@
$^
$(LDFLAGS
)
85 rb79-moderate-post
: db-
$(DB_TYPE
).o locks.o rb79-moderate-post.o \
87 $(CC
) -o
$@
$^
$(LDFLAGS
)
89 rb79-view-thread
: db-
$(DB_TYPE
).o locks.o rb79-view-thread.o util.o \
91 $(CC
) -o
$@
$^
$(LDFLAGS
)
96 find
-name
'*.o' -delete
99 rm -f rb79-delete-post
100 rm -f rb79-moderate-post
101 rm -f rb79-view-thread
105 mkdir
-p
$(DESTDIR
)$(BINDIR
)
106 cp
-f rb79-server
$(DESTDIR
)$(BINDIR
)/
107 cp
-f tools
/rb79-describe-file.sh
$(DESTDIR
)$(BINDIR
)/rb79-describe-file
108 cp
-f rb79-ban-ip
$(DESTDIR
)$(BINDIR
)/
109 cp
-f rb79-delete-post
$(DESTDIR
)$(BINDIR
)/
110 cp
-f rb79-moderate-post
$(DESTDIR
)$(BINDIR
)/
111 cp
-f rb79-view-thread
$(DESTDIR
)$(BINDIR
)/
112 mkdir
-p
$(DESTDIR
)$(MANDIR
)
113 cp
-f rb79.1
$(DESTDIR
)$(MANDIR
)/
114 cp
-f rb79-ban-ip
.1 $(DESTDIR
)$(MANDIR
)/
115 cp
-f rb79-delete-post
.1 $(DESTDIR
)$(MANDIR
)/
116 cp
-f rb79-moderate-post
.1 $(DESTDIR
)$(MANDIR
)/
117 cp
-f rb79-server
.1 $(DESTDIR
)$(MANDIR
)/
118 cp
-f rb79-view-thread
.1 $(DESTDIR
)$(MANDIR
)/
122 cd
$(DESTDIR
)$(BINDIR
) && rm -f rb79-server
123 cd
$(DESTDIR
)$(BINDIR
) && rm -f rb79-describe-file
124 cd
$(DESTDIR
)$(BINDIR
) && rm -f rb79-ban-ip
125 cd
$(DESTDIR
)$(BINDIR
) && rm -f rb79-delete-post
126 cd
$(DESTDIR
)$(BINDIR
) && rm -f rb79-moderate-post
127 cd
$(DESTDIR
)$(BINDIR
) && rm -f rb79-view-thread
128 cd
$(DESTDIR
)$(MANDIR
) && rm -f rb79.1
129 cd
$(DESTDIR
)$(MANDIR
) && rm -f rb79-ban-ip
.1
130 cd
$(DESTDIR
)$(MANDIR
) && rm -f rb79-delete-post
.1
131 cd
$(DESTDIR
)$(MANDIR
) && rm -f rb79-moderate-post
.1
132 cd
$(DESTDIR
)$(MANDIR
) && rm -f rb79-server
.1
133 cd
$(DESTDIR
)$(MANDIR
) && rm -f rb79-view-thread
.1