PageRenderTime 194ms CodeModel.GetById 100ms app.highlight 12ms RepoModel.GetById 79ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/js/rules.mk

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
Makefile | 206 lines | 133 code | 27 blank | 46 comment | 4 complexity | adcdb0684ae647a86f7ccd4c665aae4c MD5 | raw file
  1# -*- Mode: makefile -*-
  2# 
  3# ***** BEGIN LICENSE BLOCK *****
  4# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5#
  6# The contents of this file are subject to the Mozilla Public License Version
  7# 1.1 (the "License"); you may not use this file except in compliance with
  8# the License. You may obtain a copy of the License at
  9# http://www.mozilla.org/MPL/
 10#
 11# Software distributed under the License is distributed on an "AS IS" basis,
 12# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 13# for the specific language governing rights and limitations under the
 14# License.
 15# 
 16# The Original Code is Mozilla Communicator client code, released
 17# March 31, 1998.
 18# 
 19# The Initial Developer of the Original Code is
 20# Netscape Communications Corporation.
 21# Portions created by the Initial Developer are Copyright (C) 1998-1999
 22# the Initial Developer. All Rights Reserved.
 23# 
 24# Contributor(s):
 25#   Michael Ang <mang@subcarrier.org>
 26# 
 27# Alternatively, the contents of this file may be used under the terms of
 28# either of the GNU General Public License Version 2 or later (the "GPL"),
 29# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 30# in which case the provisions of the GPL or the LGPL are applicable instead
 31# of those above. If you wish to allow use of your version of this file only
 32# under the terms of either the GPL or the LGPL, and not to allow others to
 33# use your version of this file under the terms of the MPL, indicate your
 34# decision by deleting the provisions above and replace them with the notice
 35# and other provisions required by the GPL or the LGPL. If you do not delete
 36# the provisions above, a recipient may use your version of this file under
 37# the terms of any one of the MPL, the GPL or the LGPL.
 38# 
 39# ***** END LICENSE BLOCK *****
 40
 41#
 42# JSRef GNUmake makefile rules
 43#
 44
 45ifdef USE_MSVC
 46LIB_OBJS  = $(addprefix $(OBJDIR)/, $(LIB_CPPFILES:.cpp=.obj))
 47PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CPPFILES:.cpp=.obj))
 48else
 49LIB_OBJS  = $(addprefix $(OBJDIR)/, $(LIB_CPPFILES:.cpp=.o))
 50LIB_OBJS  += $(addprefix $(OBJDIR)/, $(LIB_ASFILES:.s=.o))
 51PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CPPFILES:.cpp=.o))
 52endif
 53
 54CPPFILES = $(LIB_CPPFILES) $(PROG_CPPFILES)
 55OBJS   = $(LIB_OBJS) $(PROG_OBJS)
 56
 57ifdef USE_MSVC
 58# TARGETS = $(LIBRARY)   # $(PROGRAM) not supported for MSVC yet
 59TARGETS += $(SHARED_LIBRARY) $(PROGRAM)  # it is now
 60else
 61TARGETS += $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) 
 62endif
 63
 64all:
 65	+$(LOOP_OVER_PREDIRS) 
 66ifneq "$(strip $(TARGETS))" ""
 67	$(MAKE) -f Makefile.ref $(TARGETS)
 68endif
 69	+$(LOOP_OVER_DIRS)
 70
 71$(OBJDIR)/%: %.cpp
 72	@$(MAKE_OBJDIR)
 73	$(CXX) -o $@ $(CFLAGS) $(OPTIMIZER) $< $(LDFLAGS)
 74
 75# This rule must come before the rule with no dep on header
 76$(OBJDIR)/%.o: %.cpp %.h
 77	@$(MAKE_OBJDIR)
 78	$(CXX) -o $@ -c $(CFLAGS) $(OPTIMIZER) $<
 79
 80$(OBJDIR)/jsinterp.o: jsinterp.cpp jsinterp.h
 81	@$(MAKE_OBJDIR)
 82	$(CXX) -o $@ -c $(CFLAGS) $(INTERP_OPTIMIZER) jsinterp.cpp
 83
 84$(OBJDIR)/jsbuiltins.o: jsbuiltins.cpp jsinterp.h
 85	@$(MAKE_OBJDIR)
 86	$(CXX) -o $@ -c $(CFLAGS) $(BUILTINS_OPTIMIZER) jsbuiltins.cpp
 87
 88$(OBJDIR)/%.o: %.cpp
 89	@$(MAKE_OBJDIR)
 90	$(CXX) -o $@ -c $(CFLAGS) $(OPTIMIZER) $<
 91
 92$(OBJDIR)/%.o: %.s
 93	@$(MAKE_OBJDIR)
 94	$(AS) -o $@ $(ASFLAGS) $<
 95
 96# This rule must come before rule with no dep on header
 97$(OBJDIR)/%.obj: %.cpp %.h
 98	@$(MAKE_OBJDIR)
 99	$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $(OPTIMIZER) $<
100
101$(OBJDIR)/jsinterp.obj: jsinterp.cpp jsinterp.h
102	@$(MAKE_OBJDIR)
103	$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $(INTERP_OPTIMIZER) jsinterp.cpp
104
105$(OBJDIR)/jsbuiltins.obj: jsbuiltins.cpp jsinterp.h
106	@$(MAKE_OBJDIR)
107	$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $(BUILTINS_OPTIMIZER) jsbuiltins.cpp
108
109$(OBJDIR)/%.obj: %.cpp
110	@$(MAKE_OBJDIR)
111	$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $(OPTIMIZER) $<
112
113$(OBJDIR)/js.obj: js.cpp
114	@$(MAKE_OBJDIR)
115	$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(OPTIMIZER) $<
116
117ifeq ($(OS_ARCH),OS2)
118$(LIBRARY): $(LIB_OBJS)
119	$(AR) $@ $? $(AR_OS2_SUFFIX)
120	$(RANLIB) $@
121else
122ifdef USE_MSVC
123$(SHARED_LIBRARY): $(LIB_OBJS)
124	link.exe $(LIB_LINK_FLAGS) /base:0x61000000 $(OTHER_LIBS) \
125	    /out:"$@" /pdb:none\
126	    /implib:"$(OBJDIR)/$(@F:.dll=.lib)" $^
127else
128$(LIBRARY): $(LIB_OBJS)
129	$(AR) rv $@ $?
130	$(RANLIB) $@
131
132$(SHARED_LIBRARY): $(LIB_OBJS)
133	$(MKSHLIB) -o $@ $(LIB_OBJS) $(LDFLAGS) $(OTHER_LIBS)
134endif
135endif
136
137# Java stuff
138$(CLASSDIR)/$(OBJDIR)/$(JARPATH)/%.class: %.java
139	mkdir -p $(@D)
140	$(JAVAC) $(JAVAC_FLAGS) $<
141
142define MAKE_OBJDIR
143if test ! -d $(@D); then rm -rf $(@D); mkdir -p $(@D); fi
144endef
145
146ifdef DIRS
147LOOP_OVER_DIRS		=					\
148	@for d in $(DIRS); do					\
149		if test -d $$d; then				\
150			set -e;			\
151			echo "cd $$d; $(MAKE) -f Makefile.ref $@"; 		\
152			cd $$d; $(MAKE) -f Makefile.ref $@; cd ..;	\
153			set +e;					\
154		else						\
155			echo "Skipping non-directory $$d...";	\
156		fi;						\
157	done
158endif
159
160ifdef PREDIRS
161LOOP_OVER_PREDIRS	=					\
162	@for d in $(PREDIRS); do				\
163		if test -d $$d; then				\
164			set -e;			\
165			echo "cd $$d; $(MAKE) -f Makefile.ref $@"; 		\
166			cd $$d; $(MAKE) -f Makefile.ref $@; cd ..;	\
167			set +e;					\
168		else						\
169			echo "Skipping non-directory $$d...";	\
170		fi;						\
171	done
172endif
173
174export:
175	+$(LOOP_OVER_PREDIRS)	
176	mkdir -p $(DIST)/include $(DIST)/$(LIBDIR) $(DIST)/bin
177ifneq "$(strip $(HFILES))" ""
178	$(CP) $(HFILES) $(DIST)/include
179endif
180ifneq "$(strip $(LIBRARY))" ""
181	$(CP) $(LIBRARY) $(DIST)/$(LIBDIR)
182endif
183ifneq "$(strip $(JARS))" ""
184	$(CP) $(JARS) $(DIST)/$(LIBDIR)
185endif
186ifneq "$(strip $(SHARED_LIBRARY))" ""
187	$(CP) $(SHARED_LIBRARY) $(DIST)/$(LIBDIR)
188endif
189ifneq "$(strip $(PROGRAM))" ""
190	$(CP) $(PROGRAM) $(DIST)/bin
191endif
192	+$(LOOP_OVER_DIRS)
193
194clean:
195	+$(LOOP_OVER_PREDIRS)
196	rm -rf $(OBJS) $(GARBAGE)
197
198clobber:
199	+$(LOOP_OVER_PREDIRS)
200	rm -rf $(OBJS) $(TARGETS) $(DEPENDENCIES) $(GARBAGE)
201	if test -d $(OBJDIR); then rmdir $(OBJDIR); fi
202
203tar:
204	tar cvf $(TARNAME) $(TARFILES)
205	gzip $(TARNAME)
206