-
Notifications
You must be signed in to change notification settings - Fork 71
/
GNUmakefile
64 lines (51 loc) · 1.5 KB
/
GNUmakefile
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
# This file is part of mktorrent
# Copyright (C) 2007, 2009 Emil Renner Berthing
#
# mktorrent 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 2 of the License, or
# (at your option) any later version.
#
# mktorrent 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
include Makefile
CC ?= cc
CFLAGS ?= -O2 -Wall -Wextra -Wpedantic
INSTALL ?= install
PREFIX ?= /usr/local
ifdef USE_PTHREADS
DEFINES += -DUSE_PTHREADS
SRCS := $(SRCS:hash.c=hash_pthreads.c)
LIBS += -lpthread
endif
ifdef USE_OPENSSL
DEFINES += -DUSE_OPENSSL
SRCS := $(SRCS:sha1.c=)
LIBS += -lcrypto
endif
ifdef USE_LONG_OPTIONS
DEFINES += -DUSE_LONG_OPTIONS
endif
ifdef USE_LARGE_FILES
DEFINES += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
endif
ifdef NO_HASH_CHECK
DEFINES += -DNO_HASH_CHECK
endif
ifdef MAX_OPENFD
DEFINES += -DMAX_OPENFD="$(MAX_OPENFD)"
endif
ifdef DEBUG
DEFINES += -DDEBUG
endif
OBJS = $(SRCS:.c=.o)
all: $(program)
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) $(DEFINES) -DVERSION="\"$(version)\"" -c $<
include rules.mk