Skip to content

Commit

Permalink
Merge pull request #44 from asottile/custom_functions
Browse files Browse the repository at this point in the history
Implement custom functions.  Resolves #13.
  • Loading branch information
dahlia committed Feb 4, 2015
2 parents b043a03 + b5faf60 commit 1353f25
Show file tree
Hide file tree
Showing 5 changed files with 943 additions and 13 deletions.
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This is to speed up development time.
# Usage:
# Needed once:
# $ virtualenv venv
# $ . venv/bin/activate
# $ pip install -e .`
# $ pip install werkzeug
# Once that is done, to rebuild simply:
# $ make -j 4 && python -m unittest sasstests

PY_HEADERS := -I/usr/include/python2.7
C_SOURCES := $(wildcard libsass/*.c)
C_OBJECTS = $(patsubst libsass/%.c,build2/libsass/c/%.o,$(C_SOURCES))
CPP_SOURCES := $(wildcard libsass/*.cpp)
CPP_OBJECTS = $(patsubst libsass/%.cpp,build2/libsass/cpp/%.o,$(CPP_SOURCES))

all: _sass.so

build2/libsass/c/%.o: libsass/%.c
@mkdir -p build2/libsass/c/
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I./libsass $(PY_HEADERS) -c $^ -o $@ -c -O2 -fPIC -std=c++0x -Wall -Wno-parentheses

build2/libsass/cpp/%.o: libsass/%.cpp
@mkdir -p build2/libsass/cpp/
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I./libsass $(PY_HEADERS) -c $^ -o $@ -c -O2 -fPIC -std=c++0x -Wall -Wno-parentheses

build2/pysass.o: pysass.cpp
@mkdir -p build2
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I./libsass $(PY_HEADERS) -c $^ -o $@ -c -O2 -fPIC -std=c++0x -Wall -Wno-parentheses

_sass.so: $(C_OBJECTS) $(CPP_OBJECTS) build2/pysass.o
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro $^ -L./libsass -o $@ -fPIC -lstdc++

.PHONY: clean
clean:
rm -rf build2 _sass.so

Loading

0 comments on commit 1353f25

Please sign in to comment.