jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 1 | # Copyright 2010 Google Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | # use this file except in compliance with the License. You may obtain a copy of |
| 5 | # the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations under |
| 13 | # the License. |
| 14 | |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 15 | include ../config.mk |
| 16 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 17 | ifeq ($(OS),mac) |
| 18 | RUN_PATH_FLAG = -executable_path |
| 19 | DLL_SUFFIX = .dylib |
conroy@google.com | 7c8d59f | 2011-01-27 17:50:46 +0000 | [diff] [blame] | 20 | DLLFLAGS = -bundle $(ARCHCFLAGS) -mmacosx-version-min=10.5 |
conroy@google.com | 3842d01 | 2010-10-20 17:40:04 +0000 | [diff] [blame] | 21 | CFLAGS += -DXP_MACOSX $(ARCHCFLAGS) |
| 22 | CXXFLAGS += -DXP_MACOSX $(ARCHCFLAGS) |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 23 | # Mac puts multiple architectures into the same files |
| 24 | TARGET_PLATFORM = Darwin-gcc3 |
conroy@google.com | 3842d01 | 2010-10-20 17:40:04 +0000 | [diff] [blame] | 25 | CHROME_PATH ?= /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome |
conroy@google.com | 8806978 | 2010-11-23 13:51:12 +0000 | [diff] [blame] | 26 | PLATFORM_DIR_SUFFIX = gwtDev.plugin/Contents/MacOS/ |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 27 | else |
| 28 | ifeq ($(OS),linux) |
| 29 | RUN_PATH_FLAG = -rpath-link |
| 30 | DLL_SUFFIX = .so |
| 31 | DLLFLAGS = -shared -m$(FLAG32BIT) |
| 32 | TARGET_PLATFORM = Linux_$(ARCH)-gcc3 |
conroy@google.com | 3842d01 | 2010-10-20 17:40:04 +0000 | [diff] [blame] | 33 | CHROME_PATH ?= /opt/google/chrome/chrome |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 34 | else |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 35 | endif |
| 36 | endif |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 37 | |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 38 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 39 | export FLAG32BIT |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 40 | |
conroy@google.com | 3842d01 | 2010-10-20 17:40:04 +0000 | [diff] [blame] | 41 | CFLAGS += -DBROWSER_NPAPI -DXP_UNIX -fshort-wchar |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 42 | CXXFLAGS = $(CXXONLYFLAGS) $(CFLAGS) |
| 43 | DIR = $(shell pwd) |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 44 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 45 | DEPEND = g++ -MM -MT'$$(OBJ_OUTDIR)/$(patsubst %.cpp,%.o,$(src))' \ |
| 46 | -I. -I../common $(src) |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 47 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 48 | COMMON = ../common/libcommon$(FLAG32BIT).a |
jat@google.com | 328318e | 2009-11-11 00:59:43 +0000 | [diff] [blame] | 49 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 50 | OBJ_OUTDIR = build/$(TARGET_PLATFORM) |
| 51 | EXTENSION_OUTDIR = prebuilt/gwt-dev-plugin |
| 52 | PLATFORM_DIR = $(EXTENSION_OUTDIR)/$(TARGET_PLATFORM) |
conroy@google.com | 8806978 | 2010-11-23 13:51:12 +0000 | [diff] [blame] | 53 | PLATFORM_DIR_SUFFIX ?= "" |
jat@google.com | 328318e | 2009-11-11 00:59:43 +0000 | [diff] [blame] | 54 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 55 | INSTALLER_CRX = prebuilt/gwt-dev-plugin.crx |
| 56 | DLL = $(OBJ_OUTDIR)/libGwtDevPlugin$(DLL_SUFFIX) |
conroy@google.com | 3842d01 | 2010-10-20 17:40:04 +0000 | [diff] [blame] | 57 | GWTDEV_CRX_PEM ?= $(CURDIR)/gwt-dev-plugin.pem |
| 58 | CHROME_COMMAND = $(CHROME_PATH) --pack-extension=$(CURDIR)/$(EXTENSION_OUTDIR) --no-message-box --user-data-dir=$(CURDIR)/$(OBJ_OUTDIR)/user-data --pack-extension-key=$(GWTDEV_CRX_PEM) |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 59 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 60 | #DLLFLAGS += |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 61 | |
conroy@google.com | 3842d01 | 2010-10-20 17:40:04 +0000 | [diff] [blame] | 62 | VERSION ?= 1.0.$(shell ./getversion) |
| 63 | ifeq ($(VERSION), 1.0.) |
| 64 | $(error You must specify the version if you are not in an svn checkout) |
| 65 | endif |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 66 | |
| 67 | .PHONY: default all crx lib common clean depend install install-platform \ |
conroy@google.com | 8806978 | 2010-11-23 13:51:12 +0000 | [diff] [blame] | 68 | versioned-files devmodeoptions |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 69 | |
conroy@google.com | 8806978 | 2010-11-23 13:51:12 +0000 | [diff] [blame] | 70 | default:: lib versioned-files devmodeoptions |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 71 | |
| 72 | all:: common lib install-platform crx |
| 73 | |
| 74 | lib:: $(OBJ_OUTDIR) $(EXTENSION_OUTDIR) $(DLL) |
| 75 | crx:: $(EXTENSION_OUTDIR) $(INSTALLER_CRX) |
| 76 | |
| 77 | linuxplatforms: |
| 78 | $(MAKE) lib ARCH=x86 |
| 79 | $(MAKE) lib ARCH=x86_64 |
| 80 | |
| 81 | macplatforms: |
| 82 | $(MAKE) lib |
| 83 | |
| 84 | HDRS = \ |
| 85 | LocalObjectTable.h \ |
| 86 | NPVariantWrapper.h \ |
| 87 | Plugin.h \ |
| 88 | ScriptableInstance.h \ |
| 89 | mozincludes.h \ |
| 90 | JavaObject.h |
| 91 | |
| 92 | SRCS = \ |
| 93 | main.cpp \ |
| 94 | Plugin.cpp \ |
| 95 | LocalObjectTable.cpp \ |
| 96 | JavaObject.cpp \ |
| 97 | npn_bindings.cpp \ |
| 98 | ScriptableInstance.cpp |
| 99 | |
| 100 | OBJS = $(patsubst %.cpp,$(OBJ_OUTDIR)/%.o,$(SRCS)) |
| 101 | |
| 102 | $(OBJS): $(OBJ_OUTDIR) |
| 103 | |
| 104 | $(OBJ_OUTDIR):: |
| 105 | @mkdir -p $@ |
| 106 | |
conroy@google.com | 3842d01 | 2010-10-20 17:40:04 +0000 | [diff] [blame] | 107 | $(INSTALLER_CRX): $(GWTDEV_CRX_PEM) $(EXTENSION_OUTDIR) versioned-files |
| 108 | $(shell $(CHROME_COMMAND)) |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 109 | |
jat@google.com | 328318e | 2009-11-11 00:59:43 +0000 | [diff] [blame] | 110 | versioned-files:: |
| 111 | sed -e s/GWT_DEV_PLUGIN_VERSION/$(VERSION)/ manifest-template.json >prebuilt/gwt-dev-plugin/manifest.json |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 112 | #sed -e s/GWT_DEV_PLUGIN_VERSION/$(VERSION)/ updates-template.xml >prebuilt/updates.xml |
jat@google.com | 328318e | 2009-11-11 00:59:43 +0000 | [diff] [blame] | 113 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 114 | $(DLL): $(OBJS) $(COMMON) |
| 115 | $(CXX) -m$(FLAG32BIT) -o $@ $(OBJS) $(COMMON) $(DLLFLAGS) |
| 116 | @mkdir -p $(PLATFORM_DIR) |
conroy@google.com | 8806978 | 2010-11-23 13:51:12 +0000 | [diff] [blame] | 117 | cp $(DLL) $(PLATFORM_DIR)/$(PLATFORM_DIR_SUFFIX) |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 118 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 119 | $(OBJ_OUTDIR)/%.o: %.cpp |
| 120 | $(CXX) $(CXXFLAGS) -c -o $@ -I. -I../common $< |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 121 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 122 | common $(COMMON): |
| 123 | (cd ../common && $(MAKE)) |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 124 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 125 | clean: |
| 126 | rm -rf build |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 127 | |
conroy@google.com | 8806978 | 2010-11-23 13:51:12 +0000 | [diff] [blame] | 128 | devmodeoptions: |
| 129 | (ant -f DevModeOptions/build.xml prebuilt) |
| 130 | |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 131 | depend: $(OBJ_OUTDIR) |
| 132 | ($(foreach src,$(SRCS),$(DEPEND)) true) >>Makefile |
jat@google.com | 134be54 | 2009-08-03 15:30:11 +0000 | [diff] [blame] | 133 | # makedepend -- $(CFLAGS) -- $(SRCS) |
| 134 | |
| 135 | # DO NOT DELETE |
jat@google.com | 2a2909f | 2010-10-11 18:02:47 +0000 | [diff] [blame] | 136 | $(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \ |
| 137 | $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \ |
| 138 | $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \ |
| 139 | main.cpp ../common/Debug.h ../common/Platform.h ../common/DebugLevel.h \ |
| 140 | mozincludes.h npapi/npapi.h npapi/nphostapi.h npapi/npapi.h \ |
| 141 | npapi/npruntime.h npapi/npruntime.h NPObjectWrapper.h Plugin.h \ |
| 142 | ../common/HostChannel.h ../common/Debug.h ../common/ByteOrder.h \ |
| 143 | ../common/Socket.h ../common/Message.h ../common/ReturnMessage.h \ |
| 144 | ../common/BrowserChannel.h ../common/Value.h ../common/SessionHandler.h \ |
| 145 | ../common/LoadModuleMessage.h ../common/HostChannel.h LocalObjectTable.h \ |
| 146 | ../common/SessionHandler.h ../common/HashMap.h ScriptableInstance.h \ |
| 147 | ../common/scoped_ptr/scoped_ptr.h |
| 148 | $(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \ |
| 149 | $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \ |
| 150 | $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \ |
| 151 | Plugin.cpp Plugin.h ../common/Debug.h ../common/Platform.h \ |
| 152 | ../common/DebugLevel.h mozincludes.h npapi/npapi.h npapi/nphostapi.h \ |
| 153 | npapi/npapi.h npapi/npruntime.h npapi/npruntime.h NPObjectWrapper.h \ |
| 154 | ../common/HostChannel.h ../common/Debug.h ../common/ByteOrder.h \ |
| 155 | ../common/Socket.h ../common/Message.h ../common/ReturnMessage.h \ |
| 156 | ../common/BrowserChannel.h ../common/Value.h ../common/SessionHandler.h \ |
| 157 | ../common/LoadModuleMessage.h ../common/HostChannel.h LocalObjectTable.h \ |
| 158 | ../common/SessionHandler.h ../common/HashMap.h ScriptableInstance.h \ |
| 159 | ../common/InvokeMessage.h ../common/ReturnMessage.h \ |
| 160 | ../common/ServerMethods.h ../common/scoped_ptr/scoped_ptr.h \ |
| 161 | NPVariantWrapper.h ../common/Platform.h ../common/Value.h JavaObject.h |
| 162 | $(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \ |
| 163 | $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \ |
| 164 | $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \ |
| 165 | LocalObjectTable.cpp mozincludes.h npapi/npapi.h npapi/nphostapi.h \ |
| 166 | npapi/npapi.h npapi/npruntime.h npapi/npruntime.h NPObjectWrapper.h \ |
| 167 | LocalObjectTable.h ../common/Debug.h ../common/Platform.h \ |
| 168 | ../common/DebugLevel.h |
| 169 | $(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \ |
| 170 | $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \ |
| 171 | $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \ |
| 172 | JavaObject.cpp ../common/Debug.h ../common/Platform.h \ |
| 173 | ../common/DebugLevel.h JavaObject.h mozincludes.h npapi/npapi.h \ |
| 174 | npapi/nphostapi.h npapi/npapi.h npapi/npruntime.h npapi/npruntime.h \ |
| 175 | NPObjectWrapper.h Plugin.h ../common/HostChannel.h ../common/Debug.h \ |
| 176 | ../common/ByteOrder.h ../common/Socket.h ../common/Message.h \ |
| 177 | ../common/ReturnMessage.h ../common/BrowserChannel.h ../common/Value.h \ |
| 178 | ../common/SessionHandler.h ../common/LoadModuleMessage.h \ |
| 179 | ../common/HostChannel.h LocalObjectTable.h ../common/SessionHandler.h \ |
| 180 | ../common/HashMap.h ScriptableInstance.h NPVariantWrapper.h \ |
| 181 | ../common/Platform.h ../common/Value.h |
| 182 | $(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \ |
| 183 | $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \ |
| 184 | $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \ |
| 185 | npn_bindings.cpp ../common/Debug.h ../common/Platform.h \ |
| 186 | ../common/DebugLevel.h mozincludes.h npapi/npapi.h npapi/nphostapi.h \ |
| 187 | npapi/npapi.h npapi/npruntime.h npapi/npruntime.h NPObjectWrapper.h |
| 188 | $(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \ |
| 189 | $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \ |
| 190 | $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \ |
| 191 | ScriptableInstance.cpp ScriptableInstance.h ../common/Debug.h \ |
| 192 | ../common/Platform.h ../common/DebugLevel.h mozincludes.h npapi/npapi.h \ |
| 193 | npapi/nphostapi.h npapi/npapi.h npapi/npruntime.h npapi/npruntime.h \ |
| 194 | NPObjectWrapper.h ../common/HostChannel.h ../common/Debug.h \ |
| 195 | ../common/ByteOrder.h ../common/Socket.h ../common/Message.h \ |
| 196 | ../common/ReturnMessage.h ../common/BrowserChannel.h ../common/Value.h \ |
| 197 | ../common/SessionHandler.h ../common/LoadModuleMessage.h \ |
| 198 | ../common/HostChannel.h LocalObjectTable.h ../common/SessionHandler.h \ |
| 199 | ../common/HashMap.h ../common/InvokeMessage.h ../common/ReturnMessage.h \ |
| 200 | ../common/ServerMethods.h ../common/AllowedConnections.h \ |
| 201 | ../common/scoped_ptr/scoped_ptr.h NPVariantWrapper.h \ |
| 202 | ../common/Platform.h ../common/Value.h Plugin.h JavaObject.h |