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
RevLine 
[134]1VERSION_MAJOR  = 0
2VERSION_MINOR  = 5
3VERSION_STRING = 0.6-svn
4
[231]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  =
[134]13
14ifeq ($(SYSTEM),BeOS)
[231]15TMPCXXFLAGS += -Wno-multichar
[134]16ifeq ($(BEOS_NETSERVER),yes)
[231]17TMPCFLAGS  += -DBEOS_NETSERVER
18TMPLDFLAGS += -lnet
[134]19else
[231]20TMPLDFLAGS += -lbind -lsocket
[134]21endif
22endif
23
24ifeq ($(PTHREAD),yes)
25ifeq ($(SYSTEM),FreeBSD)
[231]26TMPLDFLAGS += -pthread
[134]27else
[231]28TMPLDFLAGS += -lpthread
[134]29endif
30endif
31
32ifeq ($(OPENSSL),yes)
[231]33TMPCFLAGS  += -DHAVE_OPENSSL
34TMPLDFLAGS += -lcrypto
[134]35endif
[198]36
[231]37CFLAGS   := $(TMPCFLAGS) $(CFLAGS)
38CXXFLAGS := $(TMPCXXFLAGS) $(CXXFLAGS)
39LDFLAGS  := $(TMPLDFLAGS) $(LDFLAGS)
40
[198]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
[231]63RM    = rm -Rf
[198]64MAKE += --no-print-directory
Note: See TracBrowser for help on using the repository browser.