sassc 1.7.1 → 1.8.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/ext/libsass/.gitignore +10 -6
  4. data/ext/libsass/.travis.yml +4 -1
  5. data/ext/libsass/GNUmakefile.am +88 -0
  6. data/ext/libsass/Makefile +157 -76
  7. data/ext/libsass/Makefile.conf +47 -0
  8. data/ext/libsass/Readme.md +13 -14
  9. data/ext/libsass/appveyor.yml +25 -41
  10. data/ext/libsass/configure.ac +20 -7
  11. data/ext/libsass/contrib/plugin.cpp +1 -1
  12. data/ext/libsass/include/sass.h +15 -0
  13. data/ext/libsass/{sass.h → include/sass/base.h} +17 -9
  14. data/ext/libsass/{sass_context.h → include/sass/context.h} +3 -1
  15. data/ext/libsass/{sass_functions.h → include/sass/functions.h} +4 -4
  16. data/ext/libsass/{sass_interface.h → include/sass/interface.h} +5 -2
  17. data/ext/libsass/{sass_values.h → include/sass/values.h} +15 -1
  18. data/ext/libsass/{sass_version.h → include/sass/version.h} +0 -0
  19. data/ext/libsass/{sass_version.h.in → include/sass/version.h.in} +0 -0
  20. data/ext/libsass/{sass2scss.h → include/sass2scss.h} +6 -7
  21. data/ext/libsass/m4/m4-ax_cxx_compile_stdcxx_11.m4 +167 -0
  22. data/ext/libsass/script/ci-build-libsass +67 -23
  23. data/ext/libsass/src/GNUmakefile.am +54 -0
  24. data/ext/libsass/src/ast.cpp +2029 -0
  25. data/ext/libsass/{ast.hpp → src/ast.hpp} +832 -660
  26. data/ext/libsass/src/ast_def_macros.hpp +47 -0
  27. data/ext/libsass/src/ast_factory.hpp +93 -0
  28. data/ext/libsass/{ast_fwd_decl.hpp → src/ast_fwd_decl.hpp} +9 -4
  29. data/ext/libsass/{b64 → src/b64}/cencode.h +1 -1
  30. data/ext/libsass/{b64 → src/b64}/encode.h +0 -0
  31. data/ext/libsass/{backtrace.hpp → src/backtrace.hpp} +9 -10
  32. data/ext/libsass/{base64vlq.cpp → src/base64vlq.cpp} +2 -2
  33. data/ext/libsass/{base64vlq.hpp → src/base64vlq.hpp} +1 -2
  34. data/ext/libsass/{bind.cpp → src/bind.cpp} +96 -59
  35. data/ext/libsass/{bind.hpp → src/bind.hpp} +1 -1
  36. data/ext/libsass/src/c99func.c +54 -0
  37. data/ext/libsass/{cencode.c → src/cencode.c} +5 -5
  38. data/ext/libsass/src/color_maps.cpp +643 -0
  39. data/ext/libsass/src/color_maps.hpp +333 -0
  40. data/ext/libsass/{constants.cpp → src/constants.cpp} +10 -1
  41. data/ext/libsass/{constants.hpp → src/constants.hpp} +7 -0
  42. data/ext/libsass/{context.cpp → src/context.cpp} +152 -122
  43. data/ext/libsass/src/context.hpp +150 -0
  44. data/ext/libsass/{cssize.cpp → src/cssize.cpp} +123 -109
  45. data/ext/libsass/{cssize.hpp → src/cssize.hpp} +9 -13
  46. data/ext/libsass/{debug.hpp → src/debug.hpp} +9 -9
  47. data/ext/libsass/src/debugger.hpp +683 -0
  48. data/ext/libsass/{emitter.cpp → src/emitter.cpp} +13 -13
  49. data/ext/libsass/{emitter.hpp → src/emitter.hpp} +10 -11
  50. data/ext/libsass/src/environment.cpp +184 -0
  51. data/ext/libsass/src/environment.hpp +92 -0
  52. data/ext/libsass/src/error_handling.cpp +46 -0
  53. data/ext/libsass/src/error_handling.hpp +34 -0
  54. data/ext/libsass/src/eval.cpp +1462 -0
  55. data/ext/libsass/src/eval.hpp +107 -0
  56. data/ext/libsass/src/expand.cpp +653 -0
  57. data/ext/libsass/{expand.hpp → src/expand.hpp} +17 -16
  58. data/ext/libsass/{extend.cpp → src/extend.cpp} +198 -139
  59. data/ext/libsass/{extend.hpp → src/extend.hpp} +7 -8
  60. data/ext/libsass/{file.cpp → src/file.cpp} +103 -57
  61. data/ext/libsass/{file.hpp → src/file.hpp} +23 -14
  62. data/ext/libsass/{functions.cpp → src/functions.cpp} +642 -333
  63. data/ext/libsass/{functions.hpp → src/functions.hpp} +17 -4
  64. data/ext/libsass/{inspect.cpp → src/inspect.cpp} +147 -260
  65. data/ext/libsass/{inspect.hpp → src/inspect.hpp} +7 -7
  66. data/ext/libsass/{json.cpp → src/json.cpp} +33 -43
  67. data/ext/libsass/{json.hpp → src/json.hpp} +1 -1
  68. data/ext/libsass/{kwd_arg_macros.hpp → src/kwd_arg_macros.hpp} +0 -0
  69. data/ext/libsass/{lexer.cpp → src/lexer.cpp} +28 -0
  70. data/ext/libsass/{lexer.hpp → src/lexer.hpp} +25 -10
  71. data/ext/libsass/{listize.cpp → src/listize.cpp} +17 -13
  72. data/ext/libsass/{listize.hpp → src/listize.hpp} +0 -2
  73. data/ext/libsass/{mapping.hpp → src/mapping.hpp} +0 -0
  74. data/ext/libsass/src/memory_manager.cpp +76 -0
  75. data/ext/libsass/src/memory_manager.hpp +48 -0
  76. data/ext/libsass/{node.cpp → src/node.cpp} +89 -18
  77. data/ext/libsass/{node.hpp → src/node.hpp} +5 -6
  78. data/ext/libsass/{operation.hpp → src/operation.hpp} +18 -12
  79. data/ext/libsass/{output.cpp → src/output.cpp} +47 -55
  80. data/ext/libsass/{output.hpp → src/output.hpp} +5 -4
  81. data/ext/libsass/src/parser.cpp +2529 -0
  82. data/ext/libsass/{parser.hpp → src/parser.hpp} +84 -60
  83. data/ext/libsass/{paths.hpp → src/paths.hpp} +10 -13
  84. data/ext/libsass/{plugins.cpp → src/plugins.cpp} +14 -17
  85. data/ext/libsass/{plugins.hpp → src/plugins.hpp} +10 -11
  86. data/ext/libsass/{position.cpp → src/position.cpp} +5 -6
  87. data/ext/libsass/{position.hpp → src/position.hpp} +19 -22
  88. data/ext/libsass/{prelexer.cpp → src/prelexer.cpp} +401 -53
  89. data/ext/libsass/{prelexer.hpp → src/prelexer.hpp} +50 -10
  90. data/ext/libsass/{remove_placeholders.cpp → src/remove_placeholders.cpp} +12 -16
  91. data/ext/libsass/{remove_placeholders.hpp → src/remove_placeholders.hpp} +1 -7
  92. data/ext/libsass/{sass.cpp → src/sass.cpp} +3 -5
  93. data/ext/libsass/{sass2scss.cpp → src/sass2scss.cpp} +51 -46
  94. data/ext/libsass/{sass_context.cpp → src/sass_context.cpp} +114 -112
  95. data/ext/libsass/{sass_functions.cpp → src/sass_functions.cpp} +11 -18
  96. data/ext/libsass/{sass_interface.cpp → src/sass_interface.cpp} +44 -81
  97. data/ext/libsass/{sass_util.cpp → src/sass_util.cpp} +26 -8
  98. data/ext/libsass/{sass_util.hpp → src/sass_util.hpp} +14 -18
  99. data/ext/libsass/{sass_values.cpp → src/sass_values.cpp} +91 -20
  100. data/ext/libsass/{source_map.cpp → src/source_map.cpp} +13 -13
  101. data/ext/libsass/{source_map.hpp → src/source_map.hpp} +9 -9
  102. data/ext/libsass/{subset_map.hpp → src/subset_map.hpp} +29 -31
  103. data/ext/libsass/{support → src/support}/libsass.pc.in +0 -0
  104. data/ext/libsass/src/to_c.cpp +73 -0
  105. data/ext/libsass/src/to_c.hpp +41 -0
  106. data/ext/libsass/src/to_string.cpp +47 -0
  107. data/ext/libsass/{to_string.hpp → src/to_string.hpp} +9 -7
  108. data/ext/libsass/src/to_value.cpp +109 -0
  109. data/ext/libsass/src/to_value.hpp +50 -0
  110. data/ext/libsass/{units.cpp → src/units.cpp} +56 -51
  111. data/ext/libsass/{units.hpp → src/units.hpp} +8 -9
  112. data/ext/libsass/{utf8.h → src/utf8.h} +0 -0
  113. data/ext/libsass/{utf8 → src/utf8}/checked.h +0 -0
  114. data/ext/libsass/{utf8 → src/utf8}/core.h +12 -12
  115. data/ext/libsass/{utf8 → src/utf8}/unchecked.h +0 -0
  116. data/ext/libsass/{utf8_string.cpp → src/utf8_string.cpp} +0 -0
  117. data/ext/libsass/{utf8_string.hpp → src/utf8_string.hpp} +6 -6
  118. data/ext/libsass/{util.cpp → src/util.cpp} +144 -86
  119. data/ext/libsass/src/util.hpp +59 -0
  120. data/ext/libsass/src/values.cpp +137 -0
  121. data/ext/libsass/src/values.hpp +12 -0
  122. data/ext/libsass/test/test_node.cpp +33 -33
  123. data/ext/libsass/test/test_paths.cpp +5 -6
  124. data/ext/libsass/test/test_selector_difference.cpp +4 -5
  125. data/ext/libsass/test/test_specificity.cpp +4 -5
  126. data/ext/libsass/test/test_subset_map.cpp +91 -91
  127. data/ext/libsass/test/test_superselector.cpp +11 -11
  128. data/ext/libsass/test/test_unification.cpp +4 -4
  129. data/ext/libsass/win/libsass.targets +101 -0
  130. data/ext/libsass/win/libsass.vcxproj +45 -127
  131. data/ext/libsass/win/libsass.vcxproj.filters +303 -0
  132. data/lib/sassc/import_handler.rb +1 -1
  133. data/lib/sassc/native/native_functions_api.rb +3 -3
  134. data/lib/sassc/version.rb +1 -1
  135. data/test/custom_importer_test.rb +1 -4
  136. data/test/functions_test.rb +3 -2
  137. data/test/native_test.rb +4 -3
  138. metadata +117 -110
  139. data/ext/libsass/Makefile.am +0 -146
  140. data/ext/libsass/ast.cpp +0 -945
  141. data/ext/libsass/ast_def_macros.hpp +0 -21
  142. data/ext/libsass/ast_factory.hpp +0 -92
  143. data/ext/libsass/color_names.hpp +0 -327
  144. data/ext/libsass/context.hpp +0 -157
  145. data/ext/libsass/contextualize.cpp +0 -148
  146. data/ext/libsass/contextualize.hpp +0 -46
  147. data/ext/libsass/contextualize_eval.cpp +0 -93
  148. data/ext/libsass/contextualize_eval.hpp +0 -44
  149. data/ext/libsass/debugger.hpp +0 -558
  150. data/ext/libsass/environment.hpp +0 -163
  151. data/ext/libsass/error_handling.cpp +0 -35
  152. data/ext/libsass/error_handling.hpp +0 -32
  153. data/ext/libsass/eval.cpp +0 -1392
  154. data/ext/libsass/eval.hpp +0 -88
  155. data/ext/libsass/expand.cpp +0 -575
  156. data/ext/libsass/memory_manager.hpp +0 -57
  157. data/ext/libsass/parser.cpp +0 -2403
  158. data/ext/libsass/posix/getopt.c +0 -562
  159. data/ext/libsass/posix/getopt.h +0 -95
  160. data/ext/libsass/to_c.cpp +0 -61
  161. data/ext/libsass/to_c.hpp +0 -44
  162. data/ext/libsass/to_string.cpp +0 -34
  163. data/ext/libsass/util.hpp +0 -54
  164. data/ext/libsass/win/libsass.filters +0 -312
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17b4a4ce7436ae548d089b1dd3381361d2d85dc7
4
- data.tar.gz: f16c5f153582c6d7585c476d949c700975bf56f0
3
+ metadata.gz: 3421168f9c8ca7738cf4ef94b35eaffc8a34e282
4
+ data.tar.gz: 54335bd9f0609fc63cbfb0add785b8268afe6487
5
5
  SHA512:
6
- metadata.gz: 4152e896759007ed098028e6475233993ad1c8ebf936f2545f9db599bb0ada8046dfd3e2637ab740526bde7066048862e0208cbbf9e99173dded82f97e07f185
7
- data.tar.gz: 59b9f7569986e2f2bfede22ec4da3b75b7e3e0131324e46f2e4276ca3473b2befe7ba74fa4697ed7ea7fef32f6b03f2794a9a44330b76a85fddc9ad79dbc3ecc
6
+ metadata.gz: bf495c2e3d3e9753bb39a625d62d4e4faaa68c54d412e72b8f0774f20cdffa4e5483331f015a7b23ef3c58cb5eb9f3961c321d40ab5a608d908baa82e191bd77
7
+ data.tar.gz: 5f3e3bf2665955040480274791cb02190d15c3ed3861950c5019c6847edb075061c2104df7b8724c5924245760198a51d12e864cd6001def15476be82d01bff5
data/README.md CHANGED
@@ -6,7 +6,7 @@ This gem combines the speed of `libsass`, the [Sass C implementation](https://gi
6
6
 
7
7
  ### libsass Version
8
8
 
9
- [3.2.5](https://github.com/sass/libsass/releases/tag/3.2.5)
9
+ [3.3.0-beta3](https://github.com/sass/libsass/releases/tag/3.3.0-beta3)
10
10
 
11
11
  ## Usage
12
12
 
@@ -25,6 +25,8 @@ and [awesome contributors](https://github.com/bolandrm/sassc-ruby/graphs/contrib
25
25
 
26
26
  ## Changelog
27
27
 
28
+ - **1.8.0-beta1**
29
+ - [Update to Libsass 3.3.0-beta3](https://github.com/sass/sassc-ruby/pull/20)
28
30
  - **1.7.1**
29
31
  - Some updates to `Engine` API.
30
32
  - **1.7.0**
@@ -12,15 +12,15 @@ VERSION
12
12
 
13
13
  # Configuration stuff
14
14
 
15
- Makefile.in
15
+ GNUmakefile.in
16
+ GNUmakefile
16
17
  /aclocal.m4
17
18
  /autom4te.cache/
18
- /config.h
19
+ /src/config.h
19
20
  /config.h.in
20
21
  /config.log
21
22
  /config.status
22
23
  /configure
23
- include/
24
24
  /libtool
25
25
  /m4/libtool.m4
26
26
  /m4/ltoptions.m4
@@ -36,8 +36,9 @@ include/
36
36
  /script/ltmain.sh
37
37
  /script/missing
38
38
  /script/test-driver
39
- /stamp-h1
40
- src/Makefile
39
+ /src/stamp-h1
40
+ /src/Makefile.in
41
+ /src/Makefile
41
42
  libsass/*
42
43
 
43
44
  # Build stuff
@@ -62,13 +63,16 @@ bin/*
62
63
  .deps/
63
64
  .libs/
64
65
  win/bin
66
+ *.user
65
67
 
66
68
  # Final results
67
69
 
68
70
  sassc++
69
71
  libsass.la
70
- support/libsass.pc
72
+ src/support/libsass.pc
71
73
 
72
74
  # Cloned testing dirs
73
75
  sassc/
74
76
  sass-spec/
77
+
78
+ installer/
@@ -1,4 +1,5 @@
1
1
  language: cpp
2
+ sudo: false
2
3
 
3
4
  os:
4
5
  - linux
@@ -16,10 +17,10 @@ compiler:
16
17
  # further speed up day by day travis-ci builds
17
18
  # re-enable this if you change the makefiles
18
19
  # this will still catch all coding errors!
19
- # - AUTOTOOLS=no COVERAGE=no BUILD=shared
20
20
  # - AUTOTOOLS=yes COVERAGE=no BUILD=static
21
21
 
22
22
  env:
23
+ - AUTOTOOLS=no COVERAGE=no BUILD=shared
23
24
  - AUTOTOOLS=no COVERAGE=yes BUILD=static
24
25
  - AUTOTOOLS=yes COVERAGE=no BUILD=shared
25
26
 
@@ -31,6 +32,8 @@ matrix:
31
32
  exclude:
32
33
  - compiler: clang
33
34
  env: AUTOTOOLS=yes COVERAGE=yes BUILD=static
35
+ - os: linux
36
+ env: AUTOTOOLS=no COVERAGE=no BUILD=shared
34
37
  - os: osx
35
38
  compiler: gcc
36
39
  - os: osx
@@ -0,0 +1,88 @@
1
+ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 -I script
2
+
3
+ AM_COPT = -Wall -O2
4
+ AM_COVLDFLAGS =
5
+
6
+ if ENABLE_COVERAGE
7
+ AM_COPT = -O0 --coverage
8
+ AM_COVLDFLAGS += -lgcov
9
+ endif
10
+
11
+ AM_CPPFLAGS = -I$(top_srcdir)/include
12
+ AM_CFLAGS = $(AM_COPT)
13
+ AM_CXXFLAGS = $(AM_COPT)
14
+ AM_LDFLAGS = $(AM_COPT) $(AM_COVLDFLAGS)
15
+
16
+ # only needed to support old source tree
17
+ # we have moved the files to src folder
18
+ AM_CPPFLAGS += -I$(top_srcdir)
19
+
20
+ RESOURCES =
21
+ if COMPILER_IS_MINGW32
22
+ RESOURCES += res/libsass.rc
23
+ AM_CXXFLAGS += -std=gnu++0x
24
+ else
25
+ AM_CXXFLAGS += -std=c++0x
26
+ endif
27
+
28
+ if ENABLE_TESTS
29
+
30
+ noinst_PROGRAMS = tester
31
+
32
+ tester_LDADD = src/libsass.la
33
+ tester_SOURCES = $(SASS_SASSC_PATH)/sassc.c
34
+ tester_VERSION ?= `cd "$(SASS_SASSC_PATH)" && ./version.sh`
35
+ tester_CFLAGS = $(AM_CFLAGS) -DSASSC_VERSION="\"$(tester_VERSION)\""
36
+ tester_CXXFLAGS = $(AM_CXXFLAGS) -DSASSC_VERSION="\"$(tester_VERSION)\""
37
+ tester_LDFLAGS = $(AM_LDFLAGS)
38
+
39
+ if ENABLE_COVERAGE
40
+ nodist_EXTRA_tester_SOURCES = non-existent-file-to-force-CXX-linking.cxx
41
+ endif
42
+
43
+ SASS_SASSC_PATH ?= $(top_srcdir)/sassc
44
+ SASS_SPEC_PATH ?= $(top_srcdir)/sass-spec
45
+
46
+ TESTS = \
47
+ $(SASS_SPEC_PATH)/spec/basic \
48
+ $(SASS_SPEC_PATH)/spec/css \
49
+ $(SASS_SPEC_PATH)/spec/extend-tests \
50
+ $(SASS_SPEC_PATH)/spec/extends \
51
+ $(SASS_SPEC_PATH)/spec/libsass \
52
+ $(SASS_SPEC_PATH)/spec/libsass-closed-issues \
53
+ $(SASS_SPEC_PATH)/spec/maps \
54
+ $(SASS_SPEC_PATH)/spec/misc \
55
+ $(SASS_SPEC_PATH)/spec/regressions \
56
+ $(SASS_SPEC_PATH)/spec/scss \
57
+ $(SASS_SPEC_PATH)/spec/scss-tests \
58
+ $(SASS_SPEC_PATH)/spec/types
59
+
60
+ SASS_TEST_FLAGS =
61
+ LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) ./script/tap-driver
62
+ AM_LOG_FLAGS = -c ./tester --ignore-todo $(LOG_FLAGS)
63
+ if USE_TAP
64
+ AM_LOG_FLAGS += -t
65
+ SASS_TEST_FLAGS += -t | tapout
66
+ LOG_COMPILER = ./script/tap-runner $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
67
+ else
68
+ LOG_COMPILER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
69
+ endif
70
+
71
+ SASS_TESTER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
72
+ SASS_TESTER += -c $(SASS_LIBSASS_PATH)/tester$(EXEEXT)
73
+
74
+ test:
75
+ $(SASS_TESTER) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
76
+
77
+ test_build:
78
+ $(SASS_TESTER) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
79
+
80
+ test_full:
81
+ $(SASS_TESTER) $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
82
+
83
+ test_issues:
84
+ $(SASS_TESTER) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues $(SASS_TEST_FLAGS)
85
+
86
+ endif
87
+
88
+ SUBDIRS = src
@@ -3,7 +3,9 @@ CXX ?= g++
3
3
  RM ?= rm -f
4
4
  CP ?= cp -a
5
5
  MKDIR ?= mkdir
6
+ RMDIR ?= rmdir
6
7
  WINDRES ?= windres
8
+ INSTALL ?= install
7
9
  CFLAGS ?= -Wall
8
10
  CXXFLAGS ?= -Wall
9
11
  LDFLAGS ?= -Wall
@@ -33,48 +35,82 @@ else
33
35
  endif
34
36
  endif
35
37
 
36
- ifeq "$(LIBSASS_VERSION)" ""
37
- ifneq "$(wildcard ./.git/ )" ""
38
+ ifeq ($(SASS_LIBSASS_PATH),)
39
+ SASS_LIBSASS_PATH = $(abspath $(CURDIR))
40
+ endif
41
+
42
+ ifeq ($(LIBSASS_VERSION),)
43
+ ifneq ($(wildcard ./.git/ ),)
38
44
  LIBSASS_VERSION ?= $(shell git describe --abbrev=4 --dirty --always --tags)
39
45
  endif
40
46
  endif
41
47
 
42
- ifeq "$(LIBSASS_VERSION)" ""
43
- ifneq ("$(wildcard VERSION)","")
48
+ ifeq ($(LIBSASS_VERSION),)
49
+ ifneq ($(wildcard VERSION),)
44
50
  LIBSASS_VERSION ?= $(shell $(CAT) VERSION)
45
51
  endif
46
52
  endif
47
53
 
48
- ifneq "$(LIBSASS_VERSION)" ""
54
+ ifneq ($(LIBSASS_VERSION),)
49
55
  CFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
50
56
  CXXFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
51
57
  endif
52
58
 
53
59
  # enable mandatory flag
54
60
  ifeq (MinGW,$(UNAME))
61
+ ifneq ($(BUILD),shared)
62
+ STATIC_ALL ?= 1
63
+ endif
64
+ STATIC_LIBGCC ?= 1
65
+ STATIC_LIBSTDCPP ?= 1
55
66
  CXXFLAGS += -std=gnu++0x
56
67
  LDFLAGS += -std=gnu++0x
57
68
  else
69
+ STATIC_ALL ?= 0
70
+ STATIC_LIBGCC ?= 0
71
+ STATIC_LIBSTDCPP ?= 0
58
72
  CXXFLAGS += -std=c++0x
59
73
  LDFLAGS += -std=c++0x
60
74
  endif
61
75
 
62
- ifneq "$(SASS_LIBSASS_PATH)" ""
63
- CFLAGS += -I $(SASS_LIBSASS_PATH)
64
- CXXFLAGS += -I $(SASS_LIBSASS_PATH)
76
+ ifneq ($(SASS_LIBSASS_PATH),)
77
+ CFLAGS += -I $(SASS_LIBSASS_PATH)/include
78
+ CXXFLAGS += -I $(SASS_LIBSASS_PATH)/include
79
+ else
80
+ # this is needed for mingw
81
+ CFLAGS += -I include
82
+ CXXFLAGS += -I include
65
83
  endif
66
84
 
67
- ifneq "$(EXTRA_CFLAGS)" ""
85
+ ifneq ($(EXTRA_CFLAGS),)
68
86
  CFLAGS += $(EXTRA_CFLAGS)
69
87
  endif
70
- ifneq "$(EXTRA_CXXFLAGS)" ""
88
+ ifneq ($(EXTRA_CXXFLAGS),)
71
89
  CXXFLAGS += $(EXTRA_CXXFLAGS)
72
90
  endif
73
- ifneq "$(EXTRA_LDFLAGS)" ""
91
+ ifneq ($(EXTRA_LDFLAGS),)
74
92
  LDFLAGS += $(EXTRA_LDFLAGS)
75
93
  endif
76
94
 
77
- LDLIBS = -lstdc++ -lm
95
+ LDLIBS = -lm
96
+
97
+ ifneq ($(BUILD),shared)
98
+ LDLIBS += -lstdc++
99
+ endif
100
+
101
+ # link statically into lib
102
+ # makes it a lot more portable
103
+ # increases size by about 50KB
104
+ ifeq ($(STATIC_ALL),1)
105
+ LDFLAGS += -static
106
+ endif
107
+ ifeq ($(STATIC_LIBGCC),1)
108
+ LDFLAGS += -static-libgcc
109
+ endif
110
+ ifeq ($(STATIC_LIBSTDCPP),1)
111
+ LDFLAGS += -static-libstdc++
112
+ endif
113
+
78
114
  ifeq ($(UNAME),Darwin)
79
115
  CFLAGS += -stdlib=libc++
80
116
  CXXFLAGS += -stdlib=libc++
@@ -82,8 +118,10 @@ ifeq ($(UNAME),Darwin)
82
118
  endif
83
119
 
84
120
  ifneq (MinGW,$(UNAME))
85
- LDFLAGS += -ldl
86
- LDLIBS += -ldl
121
+ ifneq (FreeBSD,$(UNAME))
122
+ LDFLAGS += -ldl
123
+ LDLIBS += -ldl
124
+ endif
87
125
  endif
88
126
 
89
127
  ifneq ($(BUILD),shared)
@@ -104,6 +142,21 @@ SASS_SPEC_SPEC_DIR ?= spec
104
142
  SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc
105
143
  RUBY_BIN = ruby
106
144
 
145
+ LIB_STATIC = $(SASS_LIBSASS_PATH)/lib/libsass.a
146
+ LIB_SHARED = $(SASS_LIBSASS_PATH)/lib/libsass.so
147
+
148
+ ifeq (MinGW,$(UNAME))
149
+ ifeq (shared,$(BUILD))
150
+ CFLAGS += -D ADD_EXPORTS
151
+ CXXFLAGS += -D ADD_EXPORTS
152
+ LIB_SHARED = $(SASS_LIBSASS_PATH)/lib/libsass.dll
153
+ endif
154
+ else
155
+ CFLAGS += -fPIC
156
+ CXXFLAGS += -fPIC
157
+ LDFLAGS += -fPIC
158
+ endif
159
+
107
160
  ifeq (MinGW,$(UNAME))
108
161
  SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc.exe
109
162
  endif
@@ -111,59 +164,17 @@ ifeq (Windows,$(UNAME))
111
164
  SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc.exe
112
165
  endif
113
166
 
114
- SOURCES = \
115
- ast.cpp \
116
- base64vlq.cpp \
117
- bind.cpp \
118
- constants.cpp \
119
- context.cpp \
120
- contextualize.cpp \
121
- contextualize_eval.cpp \
122
- cssize.cpp \
123
- listize.cpp \
124
- error_handling.cpp \
125
- eval.cpp \
126
- expand.cpp \
127
- extend.cpp \
128
- file.cpp \
129
- functions.cpp \
130
- inspect.cpp \
131
- lexer.cpp \
132
- node.cpp \
133
- json.cpp \
134
- emitter.cpp \
135
- output.cpp \
136
- parser.cpp \
137
- plugins.cpp \
138
- position.cpp \
139
- prelexer.cpp \
140
- remove_placeholders.cpp \
141
- sass.cpp \
142
- sass_util.cpp \
143
- sass_values.cpp \
144
- sass_context.cpp \
145
- sass_functions.cpp \
146
- sass_interface.cpp \
147
- sass2scss.cpp \
148
- source_map.cpp \
149
- to_c.cpp \
150
- to_string.cpp \
151
- units.cpp \
152
- utf8_string.cpp \
153
- util.cpp
154
-
155
- CSOURCES = cencode.c
167
+ include Makefile.conf
156
168
 
157
169
  RESOURCES =
158
-
159
- LIBRARIES = lib/libsass.so
160
-
170
+ STATICLIB = lib/libsass.a
171
+ SHAREDLIB = lib/libsass.so
161
172
  ifeq (MinGW,$(UNAME))
173
+ RESOURCES += res/resource.rc
174
+ SHAREDLIB = lib/libsass.dll
162
175
  ifeq (shared,$(BUILD))
163
176
  CFLAGS += -D ADD_EXPORTS
164
177
  CXXFLAGS += -D ADD_EXPORTS
165
- LIBRARIES += lib/libsass.dll
166
- RESOURCES += res/resource.rc
167
178
  endif
168
179
  else
169
180
  CFLAGS += -fPIC
@@ -171,12 +182,18 @@ else
171
182
  LDFLAGS += -fPIC
172
183
  endif
173
184
 
174
- OBJECTS = $(SOURCES:.cpp=.o)
175
- COBJECTS = $(CSOURCES:.c=.o)
185
+ OBJECTS = $(addprefix src/,$(SOURCES:.cpp=.o))
186
+ COBJECTS = $(addprefix src/,$(CSOURCES:.c=.o))
176
187
  RCOBJECTS = $(RESOURCES:.rc=.o)
177
188
 
178
189
  DEBUG_LVL ?= NONE
179
190
 
191
+ CLEANUPS ?=
192
+ CLEANUPS += $(RCOBJECTS)
193
+ CLEANUPS += $(COBJECTS)
194
+ CLEANUPS += $(OBJECTS)
195
+ CLEANUPS += $(LIBSASS_LIB)
196
+
180
197
  all: $(BUILD)
181
198
 
182
199
  debug: $(BUILD)
@@ -191,9 +208,6 @@ debug-shared: CFLAGS := -g -DDEBUG -DDEBUG_LVL="$(DEBUG_LVL)" $(filter-out -O2,$
191
208
  debug-shared: CXXFLAGS := -g -DDEBUG -DDEBUG_LVL="$(DEBUG_LVL)" $(filter-out -O2,$(CXXFLAGS))
192
209
  debug-shared: shared
193
210
 
194
- static: lib/libsass.a
195
- shared: $(LIBRARIES)
196
-
197
211
  lib:
198
212
  $(MKDIR) lib
199
213
 
@@ -220,18 +234,61 @@ lib/libsass.dll: lib $(COBJECTS) $(OBJECTS) $(RCOBJECTS)
220
234
 
221
235
  install: install-$(BUILD)
222
236
 
223
- install-static: lib/libsass.a
224
- install -pm0755 $< $(DESTDIR)$(PREFIX)/$<
237
+ static: $(STATICLIB)
238
+ shared: $(SHAREDLIB)
239
+
240
+ $(DESTDIR)$(PREFIX):
241
+ $(MKDIR) $(DESTDIR)$(PREFIX)
242
+
243
+ $(DESTDIR)$(PREFIX)/lib: $(DESTDIR)$(PREFIX)
244
+ $(MKDIR) $(DESTDIR)$(PREFIX)/lib
245
+
246
+ $(DESTDIR)$(PREFIX)/include: $(DESTDIR)$(PREFIX)
247
+ $(MKDIR) $(DESTDIR)$(PREFIX)/include
248
+
249
+ $(DESTDIR)$(PREFIX)/include/sass: $(DESTDIR)$(PREFIX)/include
250
+ $(MKDIR) $(DESTDIR)$(PREFIX)/include/sass
225
251
 
226
- install-shared: lib/libsass.so
227
- install -pm0755 $< $(DESTDIR)$(PREFIX)/$<
252
+ $(DESTDIR)$(PREFIX)/include/%.h: include/%.h \
253
+ $(DESTDIR)$(PREFIX)/include \
254
+ $(DESTDIR)$(PREFIX)/include/sass
255
+ $(INSTALL) -v -m0644 "$<" "$@"
256
+
257
+ install-headers: $(DESTDIR)$(PREFIX)/include/sass.h \
258
+ $(DESTDIR)$(PREFIX)/include/sass2scss.h \
259
+ $(DESTDIR)$(PREFIX)/include/sass/base.h \
260
+ $(DESTDIR)$(PREFIX)/include/sass/version.h \
261
+ $(DESTDIR)$(PREFIX)/include/sass/values.h \
262
+ $(DESTDIR)$(PREFIX)/include/sass/context.h \
263
+ $(DESTDIR)$(PREFIX)/include/sass/functions.h
264
+
265
+ $(DESTDIR)$(PREFIX)/lib/%.a: lib/%.a \
266
+ $(DESTDIR)$(PREFIX)/lib
267
+ @$(INSTALL) -v -m0755 "$<" "$@"
268
+
269
+ $(DESTDIR)$(PREFIX)/lib/%.so: lib/%.so \
270
+ $(DESTDIR)$(PREFIX)/lib
271
+ @$(INSTALL) -v -m0755 "$<" "$@"
272
+
273
+ $(DESTDIR)$(PREFIX)/lib/%.dll: lib/%.dll \
274
+ $(DESTDIR)$(PREFIX)/lib
275
+ @$(INSTALL) -v -m0755 "$<" "$@"
276
+
277
+ install-static: $(DESTDIR)$(PREFIX)/lib/libsass.a
278
+
279
+ install-shared: $(DESTDIR)$(PREFIX)/lib/libsass.so \
280
+ install-headers
228
281
 
229
282
  $(SASSC_BIN): $(BUILD)
230
- cd $(SASS_SASSC_PATH) && $(MAKE)
283
+ $(MAKE) -C $(SASS_SASSC_PATH)
231
284
 
232
285
  sassc: $(SASSC_BIN)
233
286
  $(SASSC_BIN) -v
234
287
 
288
+ version: $(SASSC_BIN)
289
+ $(SASSC_BIN) -h
290
+ $(SASSC_BIN) -v
291
+
235
292
  test: $(SASSC_BIN)
236
293
  $(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) -s $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)
237
294
 
@@ -241,8 +298,32 @@ test_build: $(SASSC_BIN)
241
298
  test_issues: $(SASSC_BIN)
242
299
  $(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues
243
300
 
244
- clean:
245
- $(RM) $(RCOBJECTS) $(COBJECTS) $(OBJECTS) $(LIBRARIES) lib/*.a lib/*.so lib/*.dll lib/*.la
246
-
247
-
248
- .PHONY: all debug debug-static debug-shared static shared install install-static install-shared sassc clean
301
+ clean-objects: lib
302
+ -$(RM) lib/*.a lib/*.so lib/*.dll lib/*.la
303
+ -$(RMDIR) lib
304
+ clean: clean-objects
305
+ $(RM) $(CLEANUPS)
306
+
307
+ clean-all:
308
+ $(MAKE) -C $(SASS_SASSC_PATH) clean
309
+
310
+ lib-file: lib-file-$(BUILD)
311
+ lib-opts: lib-opts-$(BUILD)
312
+
313
+ lib-file-static:
314
+ @echo $(LIB_STATIC)
315
+ lib-file-shared:
316
+ @echo $(LIB_SHARED)
317
+ lib-opts-static:
318
+ @echo -L"$(SASS_LIBSASS_PATH)/lib"
319
+ lib-opts-shared:
320
+ @echo -L"$(SASS_LIBSASS_PATH)/lib -lsass"
321
+
322
+ .PHONY: all static shared sassc \
323
+ version install-headers \
324
+ clean clean-all clean-objects \
325
+ debug debug-static debug-shared \
326
+ install install-static install-shared \
327
+ lib-opts lib-opts-shared lib-opts-static \
328
+ lib-file lib-file-shared lib-file-static
329
+ .DELETE_ON_ERROR: