-
Notifications
You must be signed in to change notification settings - Fork 149
/
config.mk
131 lines (114 loc) · 3.18 KB
/
config.mk
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Included by Makefile. You can customize it.
# Readme about variables: https://github.com/rhcad/x3py/wiki/MakeVars
INTERFACE_DIR =$(ROOTDIR)/interface
INSTALL_DIR =$(ROOTDIR)/build
PLUGINS_DIR =$(INSTALL_DIR)/plugins
SRCPUB_DIR =$(ROOTDIR)/source/public
INCLUDES += -I$(INTERFACE_DIR)/core -I$(SRCPUB_DIR)
ifdef PKGNAME
INCLUDES += -I$(INTERFACE_DIR)/$(PKGNAME)
endif
#-------------------------------------------------------------------
# Flags for GCC and VC++
# LIBS += $(LIBPATHFLAG)yourlibpath $(LIBFLAG)yourlibname$(LIBEND)
ifdef VCBIN
CPP ="$(VCBIN)cl"
LINK ="$(VCBIN)link"
AR ="$(VCBIN)lib"
ARFLAGS =-out:
OUTFLAG =-out:
OFLAG =-Fo
LIBPATHFLAG =-libpath:
LIBPRE =lib
LIBEND =.lib
OBJEXT =.obj
LIBEXT =.lib
else
CPP =g++
LINK =g++
CPPFLAGS += -g -Wall -Wno-unused
LDFLAGS += -g -Wall
OUTFLAG =-o #space
OFLAG =-o #
ARFLAGS += #space
LIBPATHFLAG =-L
LIBFLAG =-l
OBJEXT =.o
LIBEXT =.a
endif
#-------------------------------------------------------------------
OS ?=$(shell uname -s)
IS_WIN :=$(shell echo $(OS)|grep -i Windows)
IS_MACOSX :=$(shell echo $(OS)|grep -i Darwin)
IS_CONSOLE :=$(shell echo $(APPTYPE)|grep -i console)
IS_LIB :=$(shell echo $(CPPFLAGS)|grep -i D_LIB)
IS_AFXDLL :=$(shell echo $(CPPFLAGS)|grep -i D_AFXDLL)
IS_AFXEXT :=$(shell echo $(CPPFLAGS)|grep -i D_AFXEXT)
ifndef APPTYPE # dll or lib
ifdef IS_WIN
ifndef IS_AFXEXT
CPPFLAGS += -D_USRDLL
endif
ifndef VCBIN
LDFLAGS += -shared
endif
else # unix library
CPPFLAGS += -fPIC
LDFLAGS += -shared -fPIC
endif #IS_WIN
endif #APPTYPE
ifdef IS_WIN
APPEXT =.exe
else
LIBS += -ldl
endif
#-------------------------------------------------------------------
# VC++ link options
ifdef VCBIN
INCLUDES += $(VCINC)
CPPFLAGS += -nologo $(WINSDKINC) $(VCFLAGS)
LDFLAGS += -nologo $(VCLIBS)
ifdef APPTYPE # application
ifdef IS_CONSOLE
LDFLAGS += -subsystem:console
else
LDFLAGS += -subsystem:windows
ifdef IS_AFXDLL # MFC app
LDFLAGS += -entry:"wWinMainCRTStartup"
endif
endif # IS_CONSOLE
else # not app
ifndef IS_LIB # dll
LDFLAGS += -subsystem:windows -dll
endif
endif #APPTYPE
endif #VCBIN
ifdef IS_CONSOLE
CPPFLAGS += -DCONSOLE
endif
# for generating dependency file (*.d)
DEPEND_CC =g++ -MM
ifdef VCBIN
DEPEND_CC += -D_MSC_VER=1400 -D_M_IX86
endif
DEPEND_CC += -MF
#-------------------------------------------------------------------
# Environment variables used by source/public/swig/Makefile.swig
# You may change the default values or set environment variables (must set them on Windows).
ifndef IS_WIN
ifdef IS_MACOSX
PYTHON_INCLUDE ?=/usr/include/python2.6
PYTHON_LIBFILE ?=python
JAVA_INCLUDE ?=/Library/Java/Home/include
else # Linux
PYTHON_INCLUDE ?=/usr/include/python2.7
PYTHON_LIBFILE ?=python2.7
JAVA_INCLUDE ?=/usr/lib/jvm/java-6-openjdk/include
QT4_INCLUDE ?=/usr/include/qt4
QT4_LIB ?=/usr/lib/x86_64-linux-gnu
endif
PERL5_INCLUDE ?=/usr/lib/perl/5.12.4/CORE
PERL5_LIBFILE ?=perl
RUBY_INCLUDE ?=/usr/include/ruby-1.9.1
RUBY_LIBFILE ?=ruby-1.9.1
endif