aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/Makefile.in
blob: d40ce88e990e572633dd9e3ff85d7c4f27b1d17c (plain) (blame)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 2008-2011. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# %CopyrightEnd%
#

include ../vsn.mk
include ../config.mk

# Darwin os have debug default install of wxWidgets 
FORCED_DEBUG = @FORCED_DEBUG_BUILD@
ifeq ($(FORCED_DEBUG),debug)
override TYPE=debug
endif

ifneq ($(TYPE),debug)
override TYPE=opt
endif

SO_EXT    = @SO_EXT@
OBJC_CC=@OBJC_CC@
OBJC_CFLAGS=@OBJC_CFLAGS@

GENERAL     = wxe_driver wxe_ps_init wxe_impl wxePrintout wxe_return wxe_gl
GENERAL_H   = wxe_driver.h wxe_impl.h wxe_return.h

GENERATED_F = wxe_funcs wxe_events wxe_init
GENERATED_H = gen/wxe_macros.h 

GL_H = egl_impl.h gen/glu_finit.h gen/gl_finit.h gen/gl_fdefs.h 

HAVE_OPENGL = true
OPENGL_F = gl_funcs egl_impl

ifneq ($(INSIDE_ERLSRC),true)

ERL_DIR = @ERLANG_ROOT_DIR@
ERL_INCS = -I$(ERL_DIR)/usr/include

else

include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp_ded.mk

ERL_INCS= $(DED_INCLUDES)

endif

SYS_TYPE    = @WXERL_SYS_TYPE@

GENERAL_O   = $(GENERAL:%=$(SYS_TYPE)/%.o) 
GENERATED_O = $(GENERATED_F:%=$(SYS_TYPE)/%.o)
ifeq ($(HAVE_OPENGL), true)
	GL_OBJECTS = $(OPENGL_F:%=$(SYS_TYPE)/%.o)
else
	GL_OBJECTS = 
endif

RC_FILE_EXT = @RC_FILE_TYPE@
ifeq ($(SYS_TYPE),win32)
RC_FILE     = $(SYS_TYPE)/wxe_win32.$(RC_FILE_EXT)
else 
RC_FILE     = 
endif

WX_OBJECTS  = $(GENERAL_O) $(GENERATED_O) $(RC_FILE)

OBJECTS = $(WX_OBJECTS) $(GL_OBJECTS)

TARGET_APIS = wxe_driver erl_gl
TARGET_DIR = ../priv

# -O2 -funroll-loops  -ffast-math -fomit-frame-pointer 

COMMON_CFLAGS = @DEFS@ $(ERL_INCS) 

CC		= @CC@
CPP		= @CXX@
LD		= $(CPP)
LDFLAGS		= @LDFLAGS@
RESCOMP		= @WX_RESCOMP@

ifeq (@WX_HAVE_STATIC_LIBS@,true) 
OPT_WX_LIBS      =  @WX_LIBS_STATIC@
DEBUG_WX_LIBS    =  @DEBUG_WX_LIBS_STATIC@
else
OPT_WX_LIBS      =  @WX_LIBS@
DEBUG_WX_LIBS    =  @DEBUG_WX_LIBS@
endif

ifeq ($(TYPE),debug)
WX_CFLAGS	= @DEBUG_WX_CFLAGS@
CFLAGS          = @DEBUG_CFLAGS@
WX_CXX_FLAGS	= @DEBUG_WX_CXXFLAGS@ 
CXX_FLAGS       = @DEBUG_CXXFLAGS@
WX_LIBS		= $(DEBUG_WX_LIBS)
else
WX_CFLAGS	= @WX_CFLAGS@
CFLAGS          = @CFLAGS@
WX_CXX_FLAGS	= @WX_CXXFLAGS@ 
CXX_FLAGS       = @CXXFLAGS@
WX_LIBS		= $(OPT_WX_LIBS)
endif

GL_LIBS         = @GL_LIBS@

CC_O		= $(CC) -c $(CFLAGS) $(WX_CFLAGS) $(COMMON_CFLAGS)
OBJC_CC_O	= $(OBJC_CC) -c $(CFLAGS) $(OBJC_CFLAGS) $(WX_CFLAGS) $(COMMON_CFLAGS)
CPP_O		= $(CPP) -c $(CXX_FLAGS) $(WX_CXX_FLAGS)  $(COMMON_CFLAGS) 

# Targets

opt:     $(TARGET_DIR)/wxe_driver$(SO_EXT) $(TARGET_DIR)/erl_gl$(SO_EXT)

debug:   
	@${MAKE} TYPE=debug

clean:  
	rm -f $(OBJECTS) 
	rm -f ../priv/$(TARGET_DIR)/$(TARGET_API)$(SO_EXT)
	rm -f *~ erl_crash.dump

complete_clean: 
	rm -f $(OBJECTS) 
	rm -f $(GENERATED_F:%=gen/%.cpp)
	rm -f gen/gl_funcs.cpp 
	rm -f $(GENERATED_H)
	rm -f ../priv/*/*
	rm -f *~ erl_crash.dump
	rm -f Makefile

docs:	

$(GL_OBJECTS): $(GL_H)
$(WX_OBJECTS): $(GENERATED_H) $(GENERAL_H) 

$(SYS_TYPE)/%.o: %.cpp 
	mkdir -p $(SYS_TYPE)
	$(CPP_O) $< -o $@

$(SYS_TYPE)/%.o: %.c 
	mkdir -p $(SYS_TYPE)
	$(CC_O) $< -o $@

$(SYS_TYPE)/wxe_ps_init.o: wxe_ps_init.c 
	mkdir -p $(SYS_TYPE)
	$(OBJC_CC_O) $< -o $@

$(SYS_TYPE)/%.o: gen/%.cpp 
	mkdir -p $(SYS_TYPE)
	$(CPP_O) $< -o $@

$(SYS_TYPE)/%.o: gen/%.c 
	mkdir -p $(SYS_TYPE)
	$(CC_O) $< -o $@

$(SYS_TYPE)/wxe_win32.$(RC_FILE_EXT): wxe_win32.rc
	mkdir -p $(SYS_TYPE)
	$(RESCOMP) -o $@ $< 

$(TARGET_DIR)/wxe_driver$(SO_EXT): $(WX_OBJECTS)
	mkdir -p $(TARGET_DIR)
	$(LD) $(LDFLAGS) $(WX_OBJECTS) $(WX_LIBS) -o $@

$(TARGET_DIR)/erl_gl$(SO_EXT): $(GL_OBJECTS)
	mkdir -p $(TARGET_DIR)
	$(CC) $(LDFLAGS) $(GL_OBJECTS) $(GL_LIBS) -o $@


# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
ifeq ($(INSIDE_ERLSRC),true)
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
	$(INSTALL_DIR) $(RELSYSDIR)/priv
	$(INSTALL_DATA) ../priv/erlang-logo32.png $(RELSYSDIR)/priv/
	$(INSTALL_DATA) ../priv/erlang-logo64.png $(RELSYSDIR)/priv/
	$(INSTALL_PROGRAM) $(TARGET_DIR)/wxe_driver$(SO_EXT) $(RELSYSDIR)/priv/
	$(INSTALL_PROGRAM) $(TARGET_DIR)/erl_gl$(SO_EXT) $(RELSYSDIR)/priv/

release_docs_spec:

endif