modified: n.fq
[GalaxyCodeBases.git] / tools / torrent / mktorrent_crc / GNUmakefile
blob29244abe031bf1f7aea7aa90198528b2b4846eb7
1 # This file is part of mktorrent
2 # Copyright (C) 2007, 2009 Emil Renner Berthing
4 # mktorrent is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # mktorrent is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 include Makefile
20 CC ?= cc
21 CFLAGS ?= -O2 -Wall
22 INSTALL ?= install
23 PREFIX ?= /usr/local
25 ifdef USE_PTHREADS
26 DEFINES += -DUSE_PTHREADS
27 SRCS := $(SRCS:hash.c=hash_pthreads.c)
28 LIBS += -lpthread
29 endif
31 ifdef USE_OPENSSL
32 DEFINES += -DUSE_OPENSSL
33 SRCS := $(SRCS:sha1.c=)
34 LIBS += -lcrypto
35 endif
37 ifdef USE_LONG_OPTIONS
38 DEFINES += -DUSE_LONG_OPTIONS
39 endif
41 ifdef USE_LARGE_FILES
42 DEFINES += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
43 endif
45 ifdef NO_HASH_CHECK
46 DEFINES += -DNO_HASH_CHECK
47 endif
49 ifdef MAX_OPENFD
50 DEFINES += -DMAX_OPENFD="$(MAX_OPENFD)"
51 endif
53 ifdef DEBUG
54 DEFINES += -DDEBUG
55 endif
57 OFFPRFX = $(shell ./prefix)
59 OBJS = $(SRCS:.c=.o)
61 all: $(program)
63 %.o: %.c $(HEADERS) prefix
64 $(CC) $(CFLAGS) $(DEFINES) -DPRIoff="\"$(OFFPRFX)d\"" -DVERSION="\"$(version)\"" -c $<
66 include rules.mk