Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 1353f25

Browse files
committed
Merge pull request #44 from asottile/custom_functions
Implement custom functions. Resolves #13.
2 parents b043a03 + b5faf60 commit 1353f25

File tree

5 files changed

+943
-13
lines changed

5 files changed

+943
-13
lines changed

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This is to speed up development time.
2+
# Usage:
3+
# Needed once:
4+
# $ virtualenv venv
5+
# $ . venv/bin/activate
6+
# $ pip install -e .`
7+
# $ pip install werkzeug
8+
# Once that is done, to rebuild simply:
9+
# $ make -j 4 && python -m unittest sasstests
10+
11+
PY_HEADERS := -I/usr/include/python2.7
12+
C_SOURCES := $(wildcard libsass/*.c)
13+
C_OBJECTS = $(patsubst libsass/%.c,build2/libsass/c/%.o,$(C_SOURCES))
14+
CPP_SOURCES := $(wildcard libsass/*.cpp)
15+
CPP_OBJECTS = $(patsubst libsass/%.cpp,build2/libsass/cpp/%.o,$(CPP_SOURCES))
16+
17+
all: _sass.so
18+
19+
build2/libsass/c/%.o: libsass/%.c
20+
@mkdir -p build2/libsass/c/
21+
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
22+
23+
build2/libsass/cpp/%.o: libsass/%.cpp
24+
@mkdir -p build2/libsass/cpp/
25+
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
26+
27+
build2/pysass.o: pysass.cpp
28+
@mkdir -p build2
29+
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
30+
31+
_sass.so: $(C_OBJECTS) $(CPP_OBJECTS) build2/pysass.o
32+
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro $^ -L./libsass -o $@ -fPIC -lstdc++
33+
34+
.PHONY: clean
35+
clean:
36+
rm -rf build2 _sass.so
37+

0 commit comments

Comments
 (0)