source: trunk/Makefile.common @ 231

Last change on this file since 231 was 231, checked in by titer, 16 years ago

The CFLAGS/LDFLAGS passed to configure are now put at the end at the
compile line, so our default settings (esp for -O) can be overridden

File size: 1.4 KB
Line 
1VERSION_MAJOR  = 0
2VERSION_MINOR  = 5
3VERSION_STRING = 0.6-svn
4
5TMPCFLAGS   = -g -Wall -W -O3 -funroll-loops -D_FILE_OFFSET_BITS=64 \
6              -D_LARGEFILE_SOURCE -D_GNU_SOURCE \
7              -DVERSION_MAJOR=$(VERSION_MAJOR) \
8              -DVERSION_MINOR=$(VERSION_MINOR) \
9              -DVERSION_STRING=\"$(VERSION_STRING)\" \
10              -DSYS_$(shell echo $(SYSTEM) | tr a-z A-Z)
11TMPCXXFLAGS = $(TMPCFLAGS)
12TMPLDFLAGS  =
13
14ifeq ($(SYSTEM),BeOS)
15TMPCXXFLAGS += -Wno-multichar
16ifeq ($(BEOS_NETSERVER),yes)
17TMPCFLAGS  += -DBEOS_NETSERVER
18TMPLDFLAGS += -lnet
19else
20TMPLDFLAGS += -lbind -lsocket
21endif
22endif
23
24ifeq ($(PTHREAD),yes)
25ifeq ($(SYSTEM),FreeBSD)
26TMPLDFLAGS += -pthread
27else
28TMPLDFLAGS += -lpthread
29endif
30endif
31
32ifeq ($(OPENSSL),yes)
33TMPCFLAGS  += -DHAVE_OPENSSL
34TMPLDFLAGS += -lcrypto
35endif
36
37CFLAGS   := $(TMPCFLAGS) $(CFLAGS)
38CXXFLAGS := $(TMPCXXFLAGS) $(CXXFLAGS)
39LDFLAGS  := $(TMPLDFLAGS) $(LDFLAGS)
40
41#
42# Utils
43#
44
45define DEP_RULE
46        @echo "Checking dependencies..."
47        @$(RM) .depend
48        @$(foreach SRC, $(SRCS), $(CC) -MM $(SRC) $(CFLAGS) >> .depend;)
49endef
50
51define CC_RULE
52        @echo "Cc $@"
53        @CMD="$(CC) $(CFLAGS) -o $@ -c $<"; $$CMD || \
54          ( echo "Compile line for $@ was:"; echo $$CMD; false )
55endef
56
57define LINK_RULE
58        @echo "Link $@"
59        @CMD="$(CC) -o $@ $(OBJS) $(LDFLAGS)"; $$CMD || \
60          ( echo "Compile line for $@ was:"; echo $$CMD; false )
61endef
62
63RM    = rm -Rf
64MAKE += --no-print-directory
Note: See TracBrowser for help on using the repository browser.