forked from ltworf/weborf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage
74 lines (57 loc) · 2.1 KB
/
manage
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
# Weborf
# Copyright (C) 2019 Salvo "LtWorf" Tomaselli
#
# Weborf is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#CC=gcc
#DEFS=-Ddebug
OFLAGS=-O2
#-pedantic -Wextra
DEFINES=-D_FILE_OFFSET_BITS=64
CFLAGS=-Wall $(DEFS) $(ARCHFLAGS) -Wformat -g $(OFLAGS) $(DEFINES)
LDFLAGS=-lpthread -lmagic
#Opensolaris flags
#CFLAGS=-D_POSIX_PTHREAD_SEMANTICS -Wall $(DEFS) $(ARCHFLAGS) -Wformat
#LDFLAGS=-lpthread -lsocket -lnsl
#ARCHFLAGS=-m64
MANDIR=/usr/share/man/
BINDIR=/usr/bin/
DAEMONDIR=/etc/init.d/
CONFDIR=/etc/
CGIDIR=/usr/lib/cgi-bin/
#PYDIR=/usr/lib/python$(PYVERSION)/cgi_weborf
all: weborf cgi
weborf: debug
strip weborf
combined:
$(CC) $(CFLAGS) $(LDFLAGS) $(ARCHFLAGS) -fwhole-program -combine *.c -o weborf
strip weborf
%.c: %.h
debug: cgi.o listener.o queue.o configuration.o auth.o mynet.o instance.o mystring.o utils.o base64.o buffered_reader.o webdav.o mime.o cachedir.o myio.o
$(CC) -g $(LDFLAGS) $(ARCHFLAGS) $+ -o weborf
clean:
rm -f *.o weborf debug *.orig *~ *.gz
cleanall: clean
rm -rf `find | fgrep .svn`
rm -rf `find | fgrep ~`
purge: uninstall
rm -f $(CONFDIR)/weborf.conf
source: clean style
cd ..; tar cvzf weborf-`date +\%F | tr -d -`.tar.gz weborf/
style:
#‑‑align‑pointer=name To use when will really work
astyle --indent=spaces=4 -a *.c *.h
memcheck: debug
valgrind -v --track-origins=yes --tool=memcheck --leak-check=yes --leak-resolution=high --show-reachable=yes --num-callers=20 --track-fds=yes ./weborf || echo "Valgrind doesn't appear to be installed on this system"
clangstaticcheck:
scan-build gcc -c *.c