Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support out-of-tree builds

  • Loading branch information...
commit b7a2b2ae4490ef28fadcbf1899371bc4fd012a67 1 parent 370d322
@brson authored
Showing with 21 additions and 25 deletions.
  1. +1 −0  .gitignore
  2. +17 −25 Makefile → Makefile.in
  3. +3 −0  configure
View
1  .gitignore
@@ -8,3 +8,4 @@
*.dll
*.dummy
azure-test
+build
View
42 Makefile → Makefile.in
@@ -1,3 +1,5 @@
+VPATH=%VPATH%
+
CC ?= gcc
CXX ?= g++
CXXFLAGS ?=
@@ -14,20 +16,12 @@ ifeq ($(UNAME),Linux)
OSTYPE=linux
endif
-CXXFLAGS += -fPIC
-
MOZALLOC_CPP_SRC = \
src/memory/mozalloc/mozalloc_abort.cpp \
src/memory/mozalloc/mozalloc.cpp \
src/memory/mozalloc/mozalloc_oom.cpp \
$(NULL)
-MOZALLOC_CXXFLAGS = \
- -Iinclude \
- -DNS_ATTR_MALLOC="" -DNS_WARN_UNUSED_RESULT="" \
- $(CXXFLAGS) \
- $(NULL)
-
AZURE_CPP_SRC = \
src/2d/Factory.cpp \
src/2d/Matrix.cpp \
@@ -41,21 +35,21 @@ AZURE_CPP_SRC = \
AZURE_CPP_SRC += azure-c.cpp
-AZURE_CXXFLAGS = \
- -Iinclude \
+CXXFLAGS += \
+ -fPIC \
+ -I$(VPATH)/include \
-DMOZ_GFX -DUSE_CAIRO \
-DNS_ATTR_MALLOC="" -DNS_WARN_UNUSED_RESULT="" \
- $(CXXFLAGS) \
$(NULL)
ifeq ($(OSTYPE),darwin)
# The homebrew location of a particular version of cairo
# FIXME: This is not the right way to set up the lib location
RUSTFLAGS += -L /usr/local/Cellar/cairo/1.10.2/lib
-MOZALLOC_CXXFLAGS += -DXP_MACOSX -DXP_UNIX -DMALLOC_H="<malloc/malloc.h>"
-AZURE_CXXFLAGS += \
+CXXFLAGS += \
-I/usr/local/Cellar/cairo/1.10.2/include/cairo \
-DXP_MACOSX \
+ -XP_UNIX \
$(NULL)
AZURE_CPP_SRC += \
src/2d/ScaledFontMac.cpp \
@@ -66,8 +60,7 @@ AZURE_CPP_SRC += \
endif
ifeq ($(OSTYPE),linux)
-MOZALLOC_CXXFLAGS += -DXP_UNIX
-AZURE_CXXFLAGS += \
+CXXFLAGS += \
-I/usr/include/cairo \
-DXP_UNIX \
$(NULL)
@@ -76,11 +69,14 @@ endif
ALL_CPP_SRC = $(MOZALLOC_CPP_SRC) $(AZURE_CPP_SRC)
ALL_OBJS = $(ALL_CPP_SRC:%.cpp=%.o)
-RUST_SRC=$(shell find . -type f -name '*.rs')
+RUST_SRC=$(shell find $(VPATH)/. -type f -name '*.rs')
.PHONY: all
all: libazure.dummy
+%.o: %.cpp
+ $(CXX) $< -o $@ -c $(CXXFLAGS)
+
libazure.dummy: azure.rc $(RUST_SRC) libazure.a
$(RUSTC) $(RUSTFLAGS) $< -o $@
touch $@
@@ -91,18 +87,14 @@ azure-test: azure.rc $(RUST_SRC) libazure.a
libazure.a: $(ALL_OBJS)
$(AR) rcs libazure.a $(ALL_OBJS)
-src/2d/%.o: src/2d/%.cpp
- $(CXX) $< -o $@ -c $(AZURE_CXXFLAGS)
-
-src/memory/mozalloc/%.o: src/memory/mozalloc/%.cpp
- $(CXX) $< -o $@ -c $(MOZALLOC_CXXFLAGS)
-
-./%.o: ./%.cpp
- $(CXX) $< -o $@ -c $(AZURE_CXXFLAGS)
+.PHONY: prepare-dirs
+prepare-dirs:
+ mkdir -p src/2d
+ mkdir -p src/memory/mozalloc
check: azure-test
./azure-test
.PHONY: clean
clean:
- rm -f azure-test *.o *.a */*/*.o *.so *.dylib *.dll *.dummy
+ rm -f azure-test *.o *.a */*/*.o */*/*/*.o *.so *.dylib *.dll *.dummy
View
3  configure
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+sed "s/%VPATH%/`dirname $0`/" `dirname $0`/Makefile.in > Makefile
Please sign in to comment.
Something went wrong with that request. Please try again.