summaryrefslogtreecommitdiffstats
path: root/openwrt/package/ustl/files/Common.mk
blob: dea71e1158bcc83454e49392dceea6698dfe31db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
LIBNAME		= ustl
MAJOR		= 0
MINOR		= 8
BUILD		= 0

CC		= $(CROSS)gcc 
CXX		= $(CROSS)g++ 
LD		= $(CROSS)gcc 
AR		= $(CROSS)ar
RANLIB		= $(CROSS)ranlib
DOXYGEN		= echo
INSTALL		= /usr/bin/install
RM		= rm -f
LN		= ln -sf

prefix		= /usr
exec_prefix	= /usr
BINDIR		= /usr/bin
INCDIR		= /usr/include
LIBDIR		= /usr/lib

DESTDIR		=

INSTALLDIR	= ${INSTALL} -d
INSTALLLIB	= ${INSTALL} -p -m 644
INSTALLEXE	= ${INSTALL} -p -m 755
INSTALLDATA	= ${INSTALL} -p -m 644

CWARNOPTS	= -Werror -Wall -W -Wpointer-arith -Wno-cast-align \
		-Wcast-qual -Wwrite-strings -Wredundant-decls 
CXXWARNOPTS	= ${CWARNOPTS} -Wconversion -Wsign-promo -Wsynth -Woverloaded-virtual
PROCESSOR_OPTS	=
INLINE_OPTS	= -finline-limit=65535
CUSTOMINCDIR	=
CUSTOMLIBDIR	=

BUILD_SHARED	= 1
BUILD_STATIC	= 1 
#DEBUG		= 1
#PROFILE	= 1
STANDALONE	= -nodefaultlibs 

CFLAGS		=  \
		${CUSTOMINCDIR} ${OPTFLAGS} ${CWARNOPTS} ${STANDALONE}
CXXFLAGS	=  \
		${CUSTOMINCDIR} ${OPTFLAGS} ${INLINE_OPTS} \
		${CXXWARNOPTS} ${STANDALONE} -fno-builtin
LDFLAGS		= ${CUSTOMLIBDIR} ${STANDALONE}
OPTFLAGS	= ${PROCESSOR_OPTS}
ifdef DEBUG
    OPTFLAGS	+= -O0 -g
else
    OPTFLAGS	+= -O3 -DNDEBUG=1
endif
ifdef PROFILE
    OPTFLAGS	+= -pg
endif
ifdef STANDALONE
    LIBS	+= -lsupc++ -lgcc_eh -lgcc -lc
endif
ifdef BUILD_SHARED
    CFLAGS	+= -fPIC
    CXXFLAGS	+= -fPIC
endif
SHBLDFL		= -shared

LIBA		= lib${LIBNAME}.a
LIBSO		= lib${LIBNAME}.so
ifdef MAJOR
LIBSOLNK	= ${LIBSO}.${MAJOR}.${MINOR}
LIBSOBLD	= ${LIBSO}.${MAJOR}.${MINOR}.${BUILD}
endif
TOCLEAN		+= ${LIBSO} ${LIBA} ${LIBSOBLD}