transmission/mk/common.mk

126 lines
2.7 KiB
Makefile
Raw Normal View History

2006-07-16 19:39:23 +00:00
# $Id$
TMPCFLAGS = -g -Wall -W -O3 -funroll-loops -D_FILE_OFFSET_BITS=64 \
2006-07-16 19:39:23 +00:00
-D_LARGEFILE_SOURCE -D_GNU_SOURCE \
-DSYS_$(shell echo $(SYSTEM) | tr a-z A-Z)
TMPCXXFLAGS = $(TMPCFLAGS)
TMPLDFLAGS =
ifeq ($(SYSTEM),BeOS)
TMPCXXFLAGS += -Wno-multichar
ifeq ($(BEOS_NETSERVER),yes)
TMPCFLAGS += -DBEOS_NETSERVER
TMPLDFLAGS += -lnet
else
TMPLDFLAGS += -lbind -lsocket
endif
endif
ifeq ($(PTHREAD),yes)
ifneq ($(filter FreeBSD OpenBSD,$(SYSTEM)),)
TMPCFLAGS += -pthread
TMPLDFLAGS += -pthread
else
TMPLDFLAGS += -lpthread
endif
endif
ifeq ($(OPENSSL),yes)
TMPCFLAGS += -DHAVE_OPENSSL
TMPLDFLAGS += -lcrypto
endif
CFLAGS := $(TMPCFLAGS) $(CFLAGS)
CXXFLAGS := $(TMPCXXFLAGS) $(CXXFLAGS)
LDFLAGS := $(TMPLDFLAGS) $(LDFLAGS)
#
# Utils
#
define DEP_RULE
@echo "Checking dependencies..."
@$(RM) .depend
@$(foreach SRC, $(SRCS), $(CC) -MM $(SRC) $(CFLAGS) >> .depend;)
endef
2007-03-05 03:40:05 +00:00
define DEP_RULE_CXX
@echo "Checking dependencies..."
@$(RM) .depend
@$(foreach SRC, $(SRCS), $(CXX) -MM $(SRC) $(CXXFLAGS) >> .depend;)
endef
2006-07-16 19:39:23 +00:00
define CC_RULE
@echo "Cc $@"
@CMD="$(CC) $(CFLAGS) -o $@ -c $<"; $$CMD || \
( echo "Compile line for $@ was:"; echo $$CMD; false )
endef
2007-03-05 03:40:05 +00:00
define CXX_RULE
@echo "C++ $@"
@CMD="$(CXX) $(CXXFLAGS) -o $@ -c $<"; $$CMD || \
( echo "Compile line for $@ was:"; echo $$CMD; false )
endef
2006-07-16 19:39:23 +00:00
define LINK_RULE
@echo "Link $@"
@CMD="$(CC) -o $@ $(OBJS) $(LDLIBS) $(LDFLAGS)"; $$CMD || \
2006-07-16 19:39:23 +00:00
( echo "Compile line for $@ was:"; echo $$CMD; false )
endef
2007-03-05 03:40:05 +00:00
define LINK_RULE_CXX
@echo "Link $@"
@CMD="$(CXX) -o $@ $(OBJS) $(LDLIBS) $(LDFLAGS)"; $$CMD || \
( echo "Compile line for $@ was:"; echo $$CMD; false )
endef
2006-07-16 19:39:23 +00:00
define MSGFMT_RULE
@echo "Msgfmt $<"
@msgfmt -f $< -o $@
endef
2007-03-05 03:40:05 +00:00
define XRES_RULE
@echo "Xres $@"
@xres -o $@ $@.rsrc
endef
define MIMESET_RULE
@echo "Mimeset $@"
@mimeset -f $@
endef
2006-07-16 19:39:23 +00:00
define INSTALL_BIN_RULE
@echo "Install $<"
@$(MKDIR) $(DESTDIR)$(PREFIX)/bin
@$(CP) $< $(DESTDIR)$(PREFIX)/bin/
2006-07-16 19:39:23 +00:00
endef
define INSTALL_LOCALE_RULE
@echo "Install $<"
@$(MKDIR) $(DESTDIR)$(LOCALEDIR)/$*/LC_MESSAGES
@$(CP) $< $(DESTDIR)$(LOCALEDIR)/$*/LC_MESSAGES/transmission-gtk.mo
2006-07-16 19:39:23 +00:00
endef
define INSTALL_MAN_RULE
@echo "Install $<"
@$(MKDIR) $(DESTDIR)$(PREFIX)/man/man1
@$(CP) $< $(DESTDIR)$(PREFIX)/man/man1/
2006-07-16 19:39:23 +00:00
endef
define INSTALL_DESKTOP_RULE
@echo "Install $<"
@$(MKDIR) $(DESTDIR)$(PREFIX)/share/applications
@$(CP) $< $(DESTDIR)$(PREFIX)/share/applications/
endef
define INSTALL_ICON_RULE
@echo "Install $<"
@$(MKDIR) $(DESTDIR)$(PREFIX)/share/pixmaps
@$(CP) $< $(DESTDIR)$(PREFIX)/share/pixmaps/
endef
2006-12-14 03:17:23 +00:00
RM = rm -Rf
CP = cp -f
MKDIR = mkdir -p
MAKEARGS = --no-print-directory