]>
Commit | Line | Data |
---|---|---|
2add9e3c RD |
1 | # ========================================================================= |
2 | # This makefile was generated by | |
506e9b7e | 3 | # Bakefile 0.2.5 (http://www.bakefile.org) |
2add9e3c RD |
4 | # Do not modify, all changes will be overwritten! |
5 | # ========================================================================= | |
3e5e2ea5 | 6 | |
3e5e2ea5 | 7 | |
3e5e2ea5 | 8 | |
2add9e3c RD |
9 | # ------------------------------------------------------------------------- |
10 | # These are configurable options: | |
11 | # ------------------------------------------------------------------------- | |
3e5e2ea5 | 12 | |
6e0fbb3d | 13 | # Compiler flags to link loadable module |
8ece421c | 14 | LINK_MODULE_FLAGS ?= -shared |
6e0fbb3d | 15 | |
2add9e3c | 16 | # C++ compiler |
506e9b7e | 17 | CXX = g++ |
3e5e2ea5 | 18 | |
2add9e3c | 19 | # Standard flags for C++ |
8ece421c | 20 | CXXFLAGS ?= |
3e5e2ea5 | 21 | |
2add9e3c | 22 | # Standard preprocessor flags (common for CC and CXX) |
8ece421c | 23 | CPPFLAGS ?= |
3e5e2ea5 | 24 | |
2add9e3c | 25 | # Standard linker flags |
8ece421c | 26 | LDFLAGS ?= |
3e5e2ea5 | 27 | |
2add9e3c | 28 | # Location and arguments of wx-config script |
8ece421c | 29 | WX_CONFIG ?= wx-config |
2add9e3c | 30 | |
444833b3 | 31 | # Port of the wx library to build against [gtk1,gtk2,msw,x11,motif,mgl,mac,dfb] |
8ece421c | 32 | WX_PORT ?= $(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 1) |
ae4ccf12 | 33 | |
444833b3 | 34 | # Use DLL build of wx library to use? [0,1] |
8ece421c | 35 | WX_SHARED ?= $(shell if test -z `$(WX_CONFIG) --selected-config | cut -d '-' -f 5`; then echo 1; else echo 0; fi) |
ae4ccf12 | 36 | |
444833b3 | 37 | # Compile Unicode build of wxWidgets? [0,1] |
8ece421c | 38 | WX_UNICODE ?= $(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 2 | sed 's/unicode/1/;s/ansi/0/') |
ae4ccf12 | 39 | |
444833b3 | 40 | # Use debug build of wxWidgets (define __WXDEBUG__)? [0,1] |
8ece421c | 41 | WX_DEBUG ?= $(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 3 | sed 's/debug/1/;s/release/0/') |
ae4ccf12 RD |
42 | |
43 | # Version of the wx library to build against. | |
8ece421c | 44 | WX_VERSION ?= $(shell $(WX_CONFIG) --selected-config | sed -e 's/.*-\([0-9]*\)\.\([0-9]*\)$$/\1\2/') |
2add9e3c RD |
45 | |
46 | # Build shared lib plugin | |
8ece421c | 47 | SHARED ?= 0 |
2add9e3c RD |
48 | |
49 | ||
50 | ||
51 | # ------------------------------------------------------------------------- | |
52 | # Do not modify the rest of this file! | |
53 | # ------------------------------------------------------------------------- | |
54 | ||
55 | ### Variables: ### | |
56 | ||
509f339a | 57 | CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD -MP |
ae4ccf12 RD |
58 | WX_VERSION_MAJOR = $(shell echo $(WX_VERSION) | cut -c1,1) |
59 | WX_VERSION_MINOR = $(shell echo $(WX_VERSION) | cut -c2,2) | |
60 | WX_CONFIG_FLAGS = $(WX_CONFIG_DEBUG_FLAG) $(WX_CONFIG_UNICODE_FLAG) \ | |
61 | $(WX_CONFIG_SHARED_FLAG) --toolkit=$(WX_PORT) \ | |
62 | --version=$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR) | |
63 | RENDER_CXXFLAGS = -I. `$(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)` $(CPPFLAGS) \ | |
64 | $(CXXFLAGS) | |
2add9e3c RD |
65 | RENDER_OBJECTS = \ |
66 | render_render.o | |
ae4ccf12 RD |
67 | RENDDLL_CXXFLAGS = -I. -fPIC -DPIC `$(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)` \ |
68 | $(CPPFLAGS) $(CXXFLAGS) | |
2add9e3c RD |
69 | RENDDLL_OBJECTS = \ |
70 | renddll_renddll.o | |
71 | ||
72 | ### Conditionally set variables: ### | |
73 | ||
ae4ccf12 RD |
74 | ifeq ($(WX_DEBUG),0) |
75 | WX_CONFIG_DEBUG_FLAG = --debug=no | |
76 | endif | |
77 | ifeq ($(WX_DEBUG),1) | |
78 | WX_CONFIG_DEBUG_FLAG = --debug=yes | |
79 | endif | |
80 | ifeq ($(WX_UNICODE),0) | |
81 | WX_CONFIG_UNICODE_FLAG = --unicode=no | |
82 | endif | |
83 | ifeq ($(WX_UNICODE),1) | |
84 | WX_CONFIG_UNICODE_FLAG = --unicode=yes | |
85 | endif | |
86 | ifeq ($(WX_SHARED),0) | |
87 | WX_CONFIG_SHARED_FLAG = --static=yes | |
88 | endif | |
89 | ifeq ($(WX_SHARED),1) | |
90 | WX_CONFIG_SHARED_FLAG = --static=no | |
91 | endif | |
2add9e3c RD |
92 | ifeq ($(SHARED),1) |
93 | __renddll___depname = renddll.so | |
94 | endif | |
95 | ||
96 | ||
97 | ### Targets: ### | |
98 | ||
ae4ccf12 | 99 | all: test_for_selected_wxbuild render $(__renddll___depname) |
2add9e3c | 100 | |
8ece421c | 101 | install: |
2add9e3c RD |
102 | |
103 | uninstall: | |
3e5e2ea5 JS |
104 | |
105 | clean: | |
2add9e3c RD |
106 | rm -f ./*.o |
107 | rm -f ./*.d | |
108 | rm -f render | |
109 | rm -f renddll.so | |
110 | ||
ae4ccf12 RD |
111 | test_for_selected_wxbuild: |
112 | @$(WX_CONFIG) $(WX_CONFIG_FLAGS) | |
113 | ||
2add9e3c | 114 | render: $(RENDER_OBJECTS) |
509f339a | 115 | $(CXX) -o $@ $(RENDER_OBJECTS) `$(WX_CONFIG) $(WX_CONFIG_FLAGS) --libs core,base` $(LDFLAGS) |
2add9e3c RD |
116 | |
117 | ifeq ($(SHARED),1) | |
118 | renddll.so: $(RENDDLL_OBJECTS) | |
509f339a | 119 | $(CXX) $(LINK_MODULE_FLAGS) -fPIC -o $@ $(RENDDLL_OBJECTS) `$(WX_CONFIG) $(WX_CONFIG_FLAGS) --libs core,base` $(LDFLAGS) |
2add9e3c RD |
120 | endif |
121 | ||
122 | render_render.o: ./render.cpp | |
123 | $(CXX) -c -o $@ $(RENDER_CXXFLAGS) $(CPPDEPS) $< | |
124 | ||
125 | renddll_renddll.o: ./renddll.cpp | |
126 | $(CXX) -c -o $@ $(RENDDLL_CXXFLAGS) $(CPPDEPS) $< | |
127 | ||
128 | .PHONY: all install uninstall clean | |
129 | ||
130 | ||
131 | # Dependencies tracking: | |
132 | -include ./*.d |