servo: Enable optimization by default
authorPatrick Walton <pcwalton@mimiga.net>
Thu, 12 Jul 2012 22:55:50 -0700
changeset 470866 3d23c659dcbc0824fdac17d9a4d1a29be746079a
parent 470865 ed81029d79c6ab5edfb60c4513786da889e8ad83
child 470867 cb249cdc14583be44cad0b72cac72a0c74cf1200
push id44079
push userbmo:gps@mozilla.com
push dateSat, 04 Feb 2017 00:14:49 +0000
servo: Enable optimization by default Source-Repo: https://github.com/servo/servo Source-Revision: 016c60e366a45e3e3ec7ca177cda8aaf439a7ed0
servo/Makefile.in
--- a/servo/Makefile.in
+++ b/servo/Makefile.in
@@ -1,24 +1,28 @@
 VPATH=%VPATH%
 
 RUSTC?=rustc
 RUSTFLAGS?=
 
+ifneq ($(DISABLE_OPTIMIZE),1)
+    RUSTFLAGS+=-O
+endif
+
 UNAME=$(shell uname)
 BUILD_DIR=$(shell pwd)
 
 ifeq ($(UNAME),Darwin)
     OSTYPE=darwin
 endif
 ifeq ($(UNAME),Linux)
     OSTYPE=linux
 endif
 
-RUSTFLAGS += \
+RUSTLIBS = \
 	-L src/rust-harfbuzz \
 	-L src/rust-mozjs \
 	-L src/rust-azure \
 	-L src/rust-sdl \
 	-L src/rust-cocoa \
 	-L src/rust-stb-image \
 	-L src/rust-geom \
 	-L src/rust-opengles \
@@ -93,42 +97,42 @@ CLEAN_DEPS += \
 	clean-rust-layers \
 	clean-servo \
 	$(NULL)
 
 .PHONY:	all
 all:    servo package
 
 servo:	$(SERVO_DEPS)
-	$(RUSTC) $(RUSTFLAGS) -o $@ $< --bin
+	$(RUSTC) $(RUSTFLAGS) $(RUSTLIBS) -o $@ $< --bin
 
 libservo.dummy: $(SERVO_DEPS)
-	$(RUSTC) $(RUSTFLAGS) -o $@ $<
+	$(RUSTC) $(RUSTFLAGS) $(RUSTLIBS) -o $@ $<
 
 servo-test: $(SERVO_DEPS)
-	$(RUSTC) $(RUSTFLAGS) --test -o $@ $<
+	$(RUSTC) $(RUSTFLAGS) $(RUSTLIBS) --test -o $@ $<
 
 src/ragel/ragel/ragel:
 	$(MAKE) -C src/ragel
 
 src/harfbuzz/src/.libs/libharfbuzz.a: src/ragel/ragel/ragel
 	$(MAKE) -C src/harfbuzz PATH=$(PATH):$(BUILD_DIR)/src/ragel/ragel CXXFLAGS=-fPIC LDFLAGS="-fPIC -lstdc++"
 
 src/mozjs/libjs_static.a:
 	$(MAKE) -C src/mozjs
 
 src/rust-harfbuzz/libharfbuzz.dummy: src/harfbuzz/src/.libs/libharfbuzz.a
-	$(MAKE) -C src/rust-harfbuzz RUSTFLAGS="-L ../harfbuzz/src/.libs/"
+	$(MAKE) -C src/rust-harfbuzz RUSTFLAGS="$(RUSTFLAGS) -L ../harfbuzz/src/.libs/"
 
 src/rust-mozjs/libmozjs.dummy: src/mozjs/libjs_static.a
-	RUSTFLAGS="-L ../mozjs/" CFLAGS="-I../mozjs/dist/include" \
+	RUSTFLAGS="$(RUSTFLAGS) -L ../mozjs/" CFLAGS="-I../mozjs/dist/include" \
 		$(MAKE) -C src/rust-mozjs
 
 src/rust-azure/libazure.dummy: $(AZURE_DEPS)
-	RUSTFLAGS="-L ../rust-cocoa -L ../rust-geom" $(MAKE) -C src/rust-azure
+	RUSTFLAGS="$(RUSTFLAGS) -L ../rust-cocoa -L ../rust-geom" $(MAKE) -C src/rust-azure
 
 src/rust-sdl/libsdl.dummy:
 	$(MAKE) -C src/rust-sdl
 
 src/rust-cocoa/libcocoa.dummy:
 	$(MAKE) -C src/rust-cocoa
 
 src/rust-stb-image/libstb-image.dummy:
@@ -136,39 +140,39 @@ src/rust-stb-image/libstb-image.dummy:
 
 src/rust-geom/libgeom.dummy:
 	$(MAKE) -C src/rust-geom
 
 src/rust-opengles/libopengles.dummy:
 	$(MAKE) -C src/rust-opengles
 
 src/rust-glut/libglut.dummy: $(GLUT_DEPS)
-	RUSTFLAGS="-L ../rust-opengles" $(MAKE) -C src/rust-glut
+	RUSTFLAGS="$(RUSTFLAGS) -L ../rust-opengles" $(MAKE) -C src/rust-glut
 
 src/rust-layers/liblayers.dummy: $(LAYERS_DEPS)
-	RUSTFLAGS="-L ../rust-geom -L ../rust-opengles -L ../rust-glut -L ../rust-azure -L ../rust-cocoa" \
+	RUSTFLAGS="$(RUSTFLAGS) -L ../rust-geom -L ../rust-opengles -L ../rust-glut -L ../rust-azure -L ../rust-cocoa" \
         $(MAKE) -C src/rust-layers
 
 check: $(CHECK_DEPS)
 
 check-servo: servo-test
 	./servo-test $(TESTNAME)
 
 .PHONY: check-rust-harfbuzz
 check-rust-harfbuzz: src/harfbuzz/src/.libs/libharfbuzz.a
-	$(MAKE) check -C src/rust-harfbuzz RUSTFLAGS="-L ../harfbuzz/src/.libs/"
+	$(MAKE) check -C src/rust-harfbuzz RUSTFLAGS="$(RUSTFLAGS) -L ../harfbuzz/src/.libs/"
 
 .PHONY: check-rust-mozjs
 check-rust-mozjs: src/mozjs/libjs_static.a
-	RUSTFLAGS="-L ../mozjs/" CFLAGS="-I../mozjs/dist/include" \
+	RUSTFLAGS="$(RUSTFLAGS) -L ../mozjs/" CFLAGS="-I../mozjs/dist/include" \
 		$(MAKE) check -C src/rust-mozjs
 
 .PHONY: check-rust-azure
 check-rust-azure: $(AZURE_DEPS)
-	RUSTFLAGS="-L ../rust-cocoa -L ../rust-geom" $(MAKE) check -C src/rust-azure
+	RUSTFLAGS="$(RUSTFLAGS) -L ../rust-cocoa -L ../rust-geom" $(MAKE) check -C src/rust-azure
 
 .PHONY: check-rust-sdl
 check-rust-sdl:
 	$(MAKE) check -C src/rust-sdl
 
 .PHONY: check-rust-cocoa
 check-rust-cocoa:
 	$(MAKE) check -C src/rust-cocoa
@@ -182,21 +186,21 @@ check-rust-geom:
 	$(MAKE) check -C src/rust-geom
 
 .PHONY: check-rust-opengles
 check-rust-opengles:
 	$(MAKE) check -C src/rust-opengles
 
 .PHONY: check-rust-glut
 check-rust-glut: $(GLUT_DEPS)
-	RUSTFLAGS="-L ../rust-opengles" $(MAKE) check -C src/rust-glut
+	RUSTFLAGS="$(RUSTFLAGS) -L ../rust-opengles" $(MAKE) check -C src/rust-glut
 
 .PHONY: check-rust-layers
 check-rust-layers: $(LAYERS_DEPS)
-	RUSTFLAGS="-L ../rust-geom -L ../rust-opengles -L ../rust-glut -L ../rust-azure -L ../rust-cocoa" \
+	RUSTFLAGS="$(RUSTFLAGS) -L ../rust-geom -L ../rust-opengles -L ../rust-glut -L ../rust-azure -L ../rust-cocoa" \
         $(MAKE) check -C src/rust-layers
 
 .PHONY:	clean
 clean: $(CLEAN_DEPS)
 
 .PHONY: clean-ragel
 clean-ragel:
 	$(MAKE) clean -C src/ragel