source: trunk/mk/common.mk @ 1523

Last change on this file since 1523 was 1523, checked in by joshe, 15 years ago

Turn off optimizations. I'm tired of having to edit this file and
rebuild to get a working core file.

  • Property svn:keywords set to Date Rev Author Id
File size: 2.1 KB
Line 
1# $Id: common.mk 1523 2007-03-04 23:05:18Z joshe $
2
3TMPCFLAGS   = -g -Wall -W -O0 -funroll-loops -D_FILE_OFFSET_BITS=64 \
4              -D_LARGEFILE_SOURCE -D_GNU_SOURCE \
5              -DSYS_$(shell echo $(SYSTEM) | tr a-z A-Z)
6TMPCXXFLAGS = $(TMPCFLAGS)
7TMPLDFLAGS  =
8
9ifeq ($(SYSTEM),BeOS)
10TMPCXXFLAGS += -Wno-multichar
11ifeq ($(BEOS_NETSERVER),yes)
12TMPCFLAGS  += -DBEOS_NETSERVER
13TMPLDFLAGS += -lnet
14else
15TMPLDFLAGS += -lbind -lsocket
16endif
17endif
18
19ifeq ($(PTHREAD),yes)
20ifneq ($(filter FreeBSD OpenBSD,$(SYSTEM)),)
21TMPCFLAGS  += -pthread
22TMPLDFLAGS += -pthread
23else
24TMPLDFLAGS += -lpthread
25endif
26endif
27
28ifeq ($(OPENSSL),yes)
29TMPCFLAGS  += -DHAVE_OPENSSL
30TMPLDFLAGS += -lcrypto
31endif
32
33CFLAGS   := $(TMPCFLAGS) $(CFLAGS)
34CXXFLAGS := $(TMPCXXFLAGS) $(CXXFLAGS)
35LDFLAGS  := $(TMPLDFLAGS) $(LDFLAGS)
36
37#
38# Utils
39#
40
41define DEP_RULE
42        @echo "Checking dependencies..."
43        @$(RM) .depend
44        @$(foreach SRC, $(SRCS), $(CC) -MM $(SRC) $(CFLAGS) >> .depend;)
45endef
46
47define CC_RULE
48        @echo "Cc $@"
49        @CMD="$(CC) $(CFLAGS) -o $@ -c $<"; $$CMD || \
50          ( echo "Compile line for $@ was:"; echo $$CMD; false )
51endef
52
53define LINK_RULE
54        @echo "Link $@"
55        @CMD="$(CC) -o $@ $(OBJS) $(LDLIBS) $(LDFLAGS)"; $$CMD || \
56          ( echo "Compile line for $@ was:"; echo $$CMD; false )
57endef
58
59define MSGFMT_RULE
60       @echo "Msgfmt $<"
61       @msgfmt -f $< -o $@
62endef
63
64define INSTALL_BIN_RULE
65       @echo "Install $<"
66       @$(MKDIR) $(DESTDIR)$(PREFIX)/bin
67       @$(CP) $< $(DESTDIR)$(PREFIX)/bin/
68endef
69
70define INSTALL_LOCALE_RULE
71       @echo "Install $<"
72       @$(MKDIR) $(DESTDIR)$(LOCALEDIR)/$*/LC_MESSAGES
73       @$(CP) $< $(DESTDIR)$(LOCALEDIR)/$*/LC_MESSAGES/transmission-gtk.mo
74endef
75
76define INSTALL_MAN_RULE
77        @echo "Install $<"
78        @$(MKDIR) $(DESTDIR)$(PREFIX)/man/man1
79        @$(CP) $< $(DESTDIR)$(PREFIX)/man/man1/
80endef
81
82define INSTALL_DESKTOP_RULE
83        @echo "Install $<"
84        @$(MKDIR) $(DESTDIR)$(PREFIX)/share/applications
85        @$(CP) $< $(DESTDIR)$(PREFIX)/share/applications/
86endef
87
88define INSTALL_ICON_RULE
89        @echo "Install $<"
90        @$(MKDIR) $(DESTDIR)$(PREFIX)/share/pixmaps
91        @$(CP) $< $(DESTDIR)$(PREFIX)/share/pixmaps/
92endef
93
94RM       = rm -Rf
95CP       = cp -f
96MKDIR    = mkdir -p
97MAKEARGS = --no-print-directory
Note: See TracBrowser for help on using the repository browser.