Codebase list mktorrent / e80a202b-7cfb-4192-9b86-eed1587448ac/main GNUmakefile
e80a202b-7cfb-4192-9b86-eed1587448ac/main

Tree @e80a202b-7cfb-4192-9b86-eed1587448ac/main (Download .tar.gz)

GNUmakefile @e80a202b-7cfb-4192-9b86-eed1587448ac/mainraw · history · blame

# 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
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

OFFPRFX = $(shell ./prefix)

OBJS = $(SRCS:.c=.o)

all: $(program)

%.o: %.c $(HEADERS) prefix
	$(CC) $(CFLAGS) $(DEFINES) -DPRIoff="\"$(OFFPRFX)d\"" -DVERSION="\"$(version)\"" -c $<

include rules.mk