transmission/Makefile.common

61 lines
1.2 KiB
Makefile

VERSION_MAJOR = 0
VERSION_MINOR = 5
VERSION_STRING = 0.6-svn
RM = rm -Rf
MOREFLAGS = -g -Wall -W -O3 -funroll-loops -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE_SOURCE -D_GNU_SOURCE \
-DVERSION_MAJOR=$(VERSION_MAJOR) \
-DVERSION_MINOR=$(VERSION_MINOR) \
-DVERSION_STRING=\"$(VERSION_STRING)\" \
-DSYS_$(shell echo $(SYSTEM) | tr a-z A-Z)
CFLAGS += $(MOREFLAGS)
CXXFLAGS += $(MOREFLAGS)
ifeq ($(SYSTEM),BeOS)
CXXFLAGS += -Wno-multichar
ifeq ($(BEOS_NETSERVER),yes)
CFLAGS += -DBEOS_NETSERVER
LDFLAGS += -lnet
else
LDFLAGS += -lbind -lsocket
endif
endif
ifeq ($(PTHREAD),yes)
ifeq ($(SYSTEM),FreeBSD)
LDFLAGS += -pthread
else
LDFLAGS += -lpthread
endif
endif
ifeq ($(OPENSSL),yes)
CFLAGS += -DHAVE_OPENSSL
LDFLAGS += -lcrypto
endif
#
# Utils
#
define DEP_RULE
@echo "Checking dependencies..."
@$(RM) .depend
@$(foreach SRC, $(SRCS), $(CC) -MM $(SRC) $(CFLAGS) >> .depend;)
endef
define CC_RULE
@echo "Cc $@"
@CMD="$(CC) $(CFLAGS) -o $@ -c $<"; $$CMD || \
( echo "Compile line for $@ was:"; echo $$CMD; false )
endef
define LINK_RULE
@echo "Link $@"
@CMD="$(CC) -o $@ $(OBJS) $(LDFLAGS)"; $$CMD || \
( echo "Compile line for $@ was:"; echo $$CMD; false )
endef
MAKE += --no-print-directory