sassc 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +9 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +24 -0
  8. data/Rakefile +21 -0
  9. data/ext/libsass/.editorconfig +15 -0
  10. data/ext/libsass/.gitattributes +2 -0
  11. data/ext/libsass/.gitignore +61 -0
  12. data/ext/libsass/.travis.yml +38 -0
  13. data/ext/libsass/COPYING +25 -0
  14. data/ext/libsass/INSTALL +1 -0
  15. data/ext/libsass/LICENSE +25 -0
  16. data/ext/libsass/Makefile +223 -0
  17. data/ext/libsass/Makefile.am +145 -0
  18. data/ext/libsass/Readme.md +93 -0
  19. data/ext/libsass/appveyor.yml +76 -0
  20. data/ext/libsass/ast.cpp +581 -0
  21. data/ext/libsass/ast.hpp +1949 -0
  22. data/ext/libsass/ast_def_macros.hpp +16 -0
  23. data/ext/libsass/ast_factory.hpp +87 -0
  24. data/ext/libsass/ast_fwd_decl.hpp +72 -0
  25. data/ext/libsass/b64/cencode.h +32 -0
  26. data/ext/libsass/b64/encode.h +77 -0
  27. data/ext/libsass/backtrace.hpp +81 -0
  28. data/ext/libsass/base64vlq.cpp +43 -0
  29. data/ext/libsass/base64vlq.hpp +28 -0
  30. data/ext/libsass/bind.cpp +187 -0
  31. data/ext/libsass/bind.hpp +18 -0
  32. data/ext/libsass/cencode.c +102 -0
  33. data/ext/libsass/color_names.hpp +324 -0
  34. data/ext/libsass/configure.ac +130 -0
  35. data/ext/libsass/constants.cpp +144 -0
  36. data/ext/libsass/constants.hpp +145 -0
  37. data/ext/libsass/context.cpp +507 -0
  38. data/ext/libsass/context.hpp +150 -0
  39. data/ext/libsass/contextualize.cpp +157 -0
  40. data/ext/libsass/contextualize.hpp +65 -0
  41. data/ext/libsass/copy_c_str.cpp +13 -0
  42. data/ext/libsass/copy_c_str.hpp +5 -0
  43. data/ext/libsass/debug.hpp +39 -0
  44. data/ext/libsass/environment.hpp +75 -0
  45. data/ext/libsass/error_handling.cpp +28 -0
  46. data/ext/libsass/error_handling.hpp +28 -0
  47. data/ext/libsass/eval.cpp +1149 -0
  48. data/ext/libsass/eval.hpp +80 -0
  49. data/ext/libsass/expand.cpp +430 -0
  50. data/ext/libsass/expand.hpp +77 -0
  51. data/ext/libsass/extconf.rb +6 -0
  52. data/ext/libsass/extend.cpp +1962 -0
  53. data/ext/libsass/extend.hpp +50 -0
  54. data/ext/libsass/file.cpp +291 -0
  55. data/ext/libsass/file.hpp +18 -0
  56. data/ext/libsass/functions.cpp +1565 -0
  57. data/ext/libsass/functions.hpp +187 -0
  58. data/ext/libsass/inspect.cpp +727 -0
  59. data/ext/libsass/inspect.hpp +108 -0
  60. data/ext/libsass/json.cpp +1411 -0
  61. data/ext/libsass/json.hpp +117 -0
  62. data/ext/libsass/kwd_arg_macros.hpp +23 -0
  63. data/ext/libsass/m4/.gitkeep +0 -0
  64. data/ext/libsass/mapping.hpp +17 -0
  65. data/ext/libsass/memory_manager.hpp +54 -0
  66. data/ext/libsass/node.cpp +251 -0
  67. data/ext/libsass/node.hpp +122 -0
  68. data/ext/libsass/operation.hpp +153 -0
  69. data/ext/libsass/output_compressed.cpp +401 -0
  70. data/ext/libsass/output_compressed.hpp +95 -0
  71. data/ext/libsass/output_nested.cpp +364 -0
  72. data/ext/libsass/output_nested.hpp +108 -0
  73. data/ext/libsass/parser.cpp +2016 -0
  74. data/ext/libsass/parser.hpp +264 -0
  75. data/ext/libsass/paths.hpp +69 -0
  76. data/ext/libsass/position.hpp +22 -0
  77. data/ext/libsass/posix/getopt.c +562 -0
  78. data/ext/libsass/posix/getopt.h +95 -0
  79. data/ext/libsass/prelexer.cpp +688 -0
  80. data/ext/libsass/prelexer.hpp +513 -0
  81. data/ext/libsass/remove_placeholders.cpp +59 -0
  82. data/ext/libsass/remove_placeholders.hpp +43 -0
  83. data/ext/libsass/res/resource.rc +35 -0
  84. data/ext/libsass/sass.cpp +33 -0
  85. data/ext/libsass/sass.h +60 -0
  86. data/ext/libsass/sass2scss.cpp +834 -0
  87. data/ext/libsass/sass2scss.h +110 -0
  88. data/ext/libsass/sass_context.cpp +709 -0
  89. data/ext/libsass/sass_context.h +120 -0
  90. data/ext/libsass/sass_functions.cpp +137 -0
  91. data/ext/libsass/sass_functions.h +90 -0
  92. data/ext/libsass/sass_interface.cpp +277 -0
  93. data/ext/libsass/sass_interface.h +97 -0
  94. data/ext/libsass/sass_util.cpp +136 -0
  95. data/ext/libsass/sass_util.hpp +259 -0
  96. data/ext/libsass/sass_values.cpp +337 -0
  97. data/ext/libsass/sass_values.h +124 -0
  98. data/ext/libsass/script/bootstrap +10 -0
  99. data/ext/libsass/script/branding +10 -0
  100. data/ext/libsass/script/ci-build-libsass +72 -0
  101. data/ext/libsass/script/ci-install-compiler +4 -0
  102. data/ext/libsass/script/ci-install-deps +19 -0
  103. data/ext/libsass/script/ci-report-coverage +25 -0
  104. data/ext/libsass/script/coveralls-debug +32 -0
  105. data/ext/libsass/script/spec +5 -0
  106. data/ext/libsass/script/tap-driver +652 -0
  107. data/ext/libsass/script/tap-runner +1 -0
  108. data/ext/libsass/source_map.cpp +133 -0
  109. data/ext/libsass/source_map.hpp +46 -0
  110. data/ext/libsass/subset_map.hpp +145 -0
  111. data/ext/libsass/support/libsass.pc.in +11 -0
  112. data/ext/libsass/test-driver +127 -0
  113. data/ext/libsass/test/test_node.cpp +98 -0
  114. data/ext/libsass/test/test_paths.cpp +29 -0
  115. data/ext/libsass/test/test_selector_difference.cpp +28 -0
  116. data/ext/libsass/test/test_specificity.cpp +28 -0
  117. data/ext/libsass/test/test_subset_map.cpp +472 -0
  118. data/ext/libsass/test/test_superselector.cpp +71 -0
  119. data/ext/libsass/test/test_unification.cpp +33 -0
  120. data/ext/libsass/to_c.cpp +61 -0
  121. data/ext/libsass/to_c.hpp +44 -0
  122. data/ext/libsass/to_string.cpp +29 -0
  123. data/ext/libsass/to_string.hpp +32 -0
  124. data/ext/libsass/token.hpp +32 -0
  125. data/ext/libsass/units.cpp +54 -0
  126. data/ext/libsass/units.hpp +10 -0
  127. data/ext/libsass/utf8.h +34 -0
  128. data/ext/libsass/utf8/checked.h +327 -0
  129. data/ext/libsass/utf8/core.h +329 -0
  130. data/ext/libsass/utf8/unchecked.h +228 -0
  131. data/ext/libsass/utf8_string.cpp +102 -0
  132. data/ext/libsass/utf8_string.hpp +36 -0
  133. data/ext/libsass/util.cpp +189 -0
  134. data/ext/libsass/util.hpp +26 -0
  135. data/ext/libsass/win/libsass.filters +291 -0
  136. data/ext/libsass/win/libsass.sln +28 -0
  137. data/ext/libsass/win/libsass.vcxproj +255 -0
  138. data/lib/sassc.rb +6 -0
  139. data/lib/sassc/engine.rb +13 -0
  140. data/lib/sassc/native.rb +44 -0
  141. data/lib/sassc/native/native_context_api.rb +140 -0
  142. data/lib/sassc/native/native_functions_api.rb +41 -0
  143. data/lib/sassc/native/sass_input_style.rb +11 -0
  144. data/lib/sassc/native/sass_output_style.rb +10 -0
  145. data/lib/sassc/native/sass_value.rb +95 -0
  146. data/lib/sassc/native/string_list.rb +8 -0
  147. data/lib/sassc/version.rb +3 -0
  148. data/sassc.gemspec +43 -0
  149. data/test/smoke_test.rb +171 -0
  150. data/test/test_helper.rb +4 -0
  151. metadata +281 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d92da7e90eda82d5dcd450f13935387b9ff38621
4
+ data.tar.gz: 666e1cdcc96323add6f8886f5b5c34d960f0c48b
5
+ SHA512:
6
+ metadata.gz: 52fa6623849c1ebd482b0d551f94653edcfb5c77e5a3efaca92781c37b846c0e0c44dca9cbbdbfd33558d250c87428aa8c862897a9007e2037b349439608cc14
7
+ data.tar.gz: 45aa0584e8625caf2db64e265753cbabc1b7b5a2003a446f3e2228f8db35ef29b7b8e0907a783b6d671ba5dd738a4854f9ba3f82d868a764e808fb57197ca367
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ vendor/bundle
@@ -0,0 +1,3 @@
1
+ [submodule "ext/libsass"]
2
+ path = ext/libsass
3
+ url = git://github.com/sass/libsass.git
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+
3
+ bundler_args: "--binstubs --standalone --without documentation --path ../bundle"
4
+ script: "bundle exec rake test"
5
+ rvm:
6
+ - 1.9.3
7
+ - 2.0.0
8
+ - 2.1.5
9
+ - 2.2.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in sassc.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Ryan Boland
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,24 @@
1
+ # SassC [![Build Status](https://travis-ci.org/bolandrm/sassc.svg?branch=master)](https://travis-ci.org/bolandrm/sassc)
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Usage
6
+
7
+ TODO: Write usage instructions here
8
+
9
+ ## Contributing
10
+
11
+ ### Project Setup
12
+
13
+ 1. Clone repo
14
+ 2. Install dependencies - `bundle install`
15
+ 3. Initialize the libsass submodule - `bundle exec rake submodule`
16
+ 4. Run the tests - `bundle exec rake test`
17
+
18
+ ### Code Changes
19
+
20
+ 1. Fork it ( https://github.com/[my-github-username]/sassc/fork )
21
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
22
+ 3. Commit your changes (`git commit -am 'Add some feature'`) - try to include tests
23
+ 4. Push to the branch (`git push origin my-new-feature`)
24
+ 5. Create a new Pull Request
@@ -0,0 +1,21 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ task default: :prepare
4
+
5
+ task prepare: "ext/lib/libsass.so"
6
+
7
+ file "ext/lib/libsass.so" do
8
+ gem_dir = File.expand_path(File.dirname(__FILE__)) + "/"
9
+ cd "ext/libsass"
10
+ sh "make lib/libsass.so"
11
+ cd gem_dir
12
+ end
13
+
14
+ task test: :prepare do
15
+ $LOAD_PATH.unshift('lib', 'test')
16
+ Dir.glob('./test/**/*_test.rb') { |f| require f }
17
+ end
18
+
19
+ task :submodule do
20
+ sh "git submodule update --init"
21
+ end
@@ -0,0 +1,15 @@
1
+ # This file is for unifying the coding style for different editors and IDEs
2
+ # editorconfig.org
3
+
4
+ root = true
5
+
6
+ [*]
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+ indent_style = spaces
11
+ indent_size = 2
12
+
13
+ [{Makefile, Makefile.am}]
14
+ indent_style = tab
15
+ indent_size = 4
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,61 @@
1
+ # Miscellaneous stuff
2
+
3
+ .DS_Store
4
+ .sass-cache
5
+ *.gem
6
+ *.gcno
7
+ .svn/*
8
+ .cproject
9
+ .project
10
+ .settings/
11
+
12
+ # Configuration stuff
13
+
14
+ Makefile.in
15
+ /aclocal.m4
16
+ /autom4te.cache/
17
+ /config.guess
18
+ /config.h
19
+ /config.h.in
20
+ /config.log
21
+ /config.status
22
+ /config.sub
23
+ /configure
24
+ /depcomp
25
+ /install-sh
26
+ /libtool
27
+ /ltmain.sh
28
+ /m4/libtool.m4
29
+ /m4/ltoptions.m4
30
+ /m4/ltsugar.m4
31
+ /m4/ltversion.m4
32
+ /m4/lt~obsolete.m4
33
+ /missing
34
+ /stamp-h1
35
+ src/Makefile
36
+ libsass/*
37
+
38
+ # Build stuff
39
+
40
+ *.o
41
+ *.lo
42
+ *.so
43
+ *.dll
44
+ *.a
45
+ a.out
46
+ libsass.js
47
+
48
+ bin/*
49
+ .deps/
50
+ .libs/
51
+ win/bin
52
+
53
+ # Final results
54
+
55
+ sassc++
56
+ libsass.la
57
+ support/libsass.pc
58
+
59
+ # Cloned testing dirs
60
+ sassc/
61
+ sass-spec/
@@ -0,0 +1,38 @@
1
+ language: cpp
2
+
3
+ os:
4
+ - linux
5
+ # - osx
6
+
7
+ compiler:
8
+ - gcc
9
+ - clang
10
+
11
+ # don't create redundant code coverage reports
12
+ # - AUTOTOOLS=yes COVERAGE=yes BUILD=static
13
+ # - AUTOTOOLS=no COVERAGE=yes BUILD=shared
14
+ # - AUTOTOOLS=no COVERAGE=no BUILD=static
15
+
16
+ # further speed up day by day travis-ci builds
17
+ # re-enable this if you change the makefiles
18
+ # this will still catch all coding errors!
19
+ # - AUTOTOOLS=no COVERAGE=no BUILD=shared
20
+ # - AUTOTOOLS=yes COVERAGE=no BUILD=static
21
+
22
+ env:
23
+ - AUTOTOOLS=no COVERAGE=yes BUILD=static
24
+ - AUTOTOOLS=yes COVERAGE=no BUILD=shared
25
+
26
+ # currenty there are various issues when
27
+ # built with coverage, clang and autotools
28
+ # - AUTOTOOLS=yes COVERAGE=yes BUILD=shared
29
+
30
+ matrix:
31
+ exclude:
32
+ - compiler: clang
33
+ env: AUTOTOOLS=yes COVERAGE=yes BUILD=static
34
+
35
+ script: ./script/ci-build-libsass
36
+ before_install: ./script/ci-install-deps
37
+ install: ./script/ci-install-compiler
38
+ after_success: ./script/ci-report-coverage
@@ -0,0 +1,25 @@
1
+
2
+ Copyright (C) 2012 by Hampton Catlin
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the "Software"), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8
+ of the Software, and to permit persons to whom the Software is furnished to do
9
+ so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+
22
+
23
+ The following files in the spec were taken from the original Ruby Sass project which
24
+ is copyright Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein and under
25
+ the same license.
@@ -0,0 +1 @@
1
+ // Autotools requires us to have this file. Boo.
@@ -0,0 +1,25 @@
1
+
2
+ Copyright (C) 2012 by Hampton Catlin
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the "Software"), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8
+ of the Software, and to permit persons to whom the Software is furnished to do
9
+ so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+
22
+
23
+ The following files in the spec were taken from the original Ruby Sass project which
24
+ is copyright Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein and under
25
+ the same license.
@@ -0,0 +1,223 @@
1
+ CC ?= gcc
2
+ CXX ?= g++
3
+ RM ?= rm -f
4
+ CP ?= cp -a
5
+ MKDIR ?= mkdir -p
6
+ WINDRES ?= windres
7
+ CFLAGS ?= -Wall -O2
8
+ CXXFLAGS ?= -Wall -O2
9
+ LDFLAGS ?= -Wall -O2
10
+
11
+ ifneq (,$(findstring /cygdrive/,$(PATH)))
12
+ UNAME := Cygwin
13
+ else
14
+ ifneq (,$(findstring WINDOWS,$(PATH)))
15
+ UNAME := Windows
16
+ else
17
+ ifneq (,$(findstring mingw32,$(MAKE)))
18
+ UNAME := MinGW
19
+ else
20
+ UNAME := $(shell uname -s)
21
+ endif
22
+ endif
23
+ endif
24
+
25
+ ifeq "$(LIBSASS_VERSION)" ""
26
+ ifneq "$(wildcard ./.git/ )" ""
27
+ LIBSASS_VERSION ?= $(shell git describe --abbrev=4 --dirty --always --tags)
28
+ endif
29
+ endif
30
+
31
+ ifneq "$(LIBSASS_VERSION)" ""
32
+ CFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
33
+ CXXFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
34
+ endif
35
+
36
+ # enable mandatory flag
37
+ ifeq (MinGW,$(UNAME))
38
+ CXXFLAGS += -std=gnu++0x
39
+ LDFLAGS += -std=gnu++0x
40
+ else
41
+ CXXFLAGS += -std=c++0x
42
+ LDFLAGS += -std=c++0x
43
+ endif
44
+
45
+ ifneq "$(SASS_LIBSASS_PATH)" ""
46
+ CFLAGS += -I $(SASS_LIBSASS_PATH)
47
+ CXXFLAGS += -I $(SASS_LIBSASS_PATH)
48
+ endif
49
+
50
+ ifneq "$(EXTRA_CFLAGS)" ""
51
+ CFLAGS += $(EXTRA_CFLAGS)
52
+ endif
53
+ ifneq "$(EXTRA_CXXFLAGS)" ""
54
+ CXXFLAGS += $(EXTRA_CXXFLAGS)
55
+ endif
56
+ ifneq "$(EXTRA_LDFLAGS)" ""
57
+ LDFLAGS += $(EXTRA_LDFLAGS)
58
+ endif
59
+
60
+ LDLIBS = -lstdc++ -lm
61
+ ifeq ($(UNAME),Darwin)
62
+ CFLAGS += -stdlib=libc++
63
+ CXXFLAGS += -stdlib=libc++
64
+ LDFLAGS += -stdlib=libc++
65
+ endif
66
+
67
+ ifneq ($(BUILD),shared)
68
+ BUILD = static
69
+ endif
70
+
71
+ ifeq (,$(PREFIX))
72
+ ifeq (,$(TRAVIS_BUILD_DIR))
73
+ PREFIX = /usr/local
74
+ else
75
+ PREFIX = $(TRAVIS_BUILD_DIR)
76
+ endif
77
+ endif
78
+
79
+ SASS_SASSC_PATH ?= sassc
80
+ SASS_SPEC_PATH ?= sass-spec
81
+ SASS_SPEC_SPEC_DIR ?= spec
82
+ SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc
83
+ RUBY_BIN = ruby
84
+
85
+ ifeq (MinGW,$(UNAME))
86
+ SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc.exe
87
+ endif
88
+ ifeq (Windows,$(UNAME))
89
+ SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc.exe
90
+ endif
91
+
92
+ SOURCES = \
93
+ ast.cpp \
94
+ base64vlq.cpp \
95
+ bind.cpp \
96
+ constants.cpp \
97
+ context.cpp \
98
+ contextualize.cpp \
99
+ copy_c_str.cpp \
100
+ error_handling.cpp \
101
+ eval.cpp \
102
+ expand.cpp \
103
+ extend.cpp \
104
+ file.cpp \
105
+ functions.cpp \
106
+ inspect.cpp \
107
+ node.cpp \
108
+ json.cpp \
109
+ output_compressed.cpp \
110
+ output_nested.cpp \
111
+ parser.cpp \
112
+ prelexer.cpp \
113
+ remove_placeholders.cpp \
114
+ sass.cpp \
115
+ sass_util.cpp \
116
+ sass_values.cpp \
117
+ sass_context.cpp \
118
+ sass_functions.cpp \
119
+ sass_interface.cpp \
120
+ sass2scss.cpp \
121
+ source_map.cpp \
122
+ to_c.cpp \
123
+ to_string.cpp \
124
+ units.cpp \
125
+ utf8_string.cpp \
126
+ util.cpp
127
+
128
+ CSOURCES = cencode.c
129
+
130
+ RESOURCES =
131
+
132
+ LIBRARIES = lib/libsass.so
133
+
134
+ ifeq (MinGW,$(UNAME))
135
+ ifeq (shared,$(BUILD))
136
+ CFLAGS += -D ADD_EXPORTS
137
+ CXXFLAGS += -D ADD_EXPORTS
138
+ LIBRARIES += lib/libsass.dll
139
+ RESOURCES += res/resource.rc
140
+ endif
141
+ else
142
+ CFLAGS += -fPIC
143
+ CXXFLAGS += -fPIC
144
+ LDFLAGS += -fPIC
145
+ endif
146
+
147
+ OBJECTS = $(SOURCES:.cpp=.o)
148
+ COBJECTS = $(CSOURCES:.c=.o)
149
+ RCOBJECTS = $(RESOURCES:.rc=.o)
150
+
151
+ DEBUG_LVL ?= NONE
152
+
153
+ all: $(BUILD)
154
+
155
+ debug: $(BUILD)
156
+
157
+ debug-static: LDFLAGS := -g $(filter-out -O2,$(LDFLAGS))
158
+ debug-static: CFLAGS := -g -DDEBUG -DDEBUG_LVL="$(DEBUG_LVL)" $(filter-out -O2,$(CFLAGS))
159
+ debug-static: CXXFLAGS := -g -DDEBUG -DDEBUG_LVL="$(DEBUG_LVL)" $(filter-out -O2,$(CXXFLAGS))
160
+ debug-static: static
161
+
162
+ debug-shared: LDFLAGS := -g $(filter-out -O2,$(LDFLAGS))
163
+ debug-shared: CFLAGS := -g -DDEBUG -DDEBUG_LVL="$(DEBUG_LVL)" $(filter-out -O2,$(CFLAGS))
164
+ debug-shared: CXXFLAGS := -g -DDEBUG -DDEBUG_LVL="$(DEBUG_LVL)" $(filter-out -O2,$(CXXFLAGS))
165
+ debug-shared: shared
166
+
167
+ static: lib/libsass.a
168
+ shared: $(LIBRARIES)
169
+
170
+ lib/libsass.a: $(COBJECTS) $(OBJECTS)
171
+ $(MKDIR) lib
172
+ $(AR) rcvs $@ $(COBJECTS) $(OBJECTS)
173
+
174
+ lib/libsass.so: $(COBJECTS) $(OBJECTS)
175
+ $(MKDIR) lib
176
+ $(CXX) -shared $(LDFLAGS) -o $@ $(COBJECTS) $(OBJECTS) $(LDLIBS)
177
+
178
+ lib/libsass.dll: $(COBJECTS) $(OBJECTS) $(RCOBJECTS)
179
+ $(MKDIR) lib
180
+ $(CXX) -shared $(LDFLAGS) -o $@ $(COBJECTS) $(OBJECTS) $(RCOBJECTS) $(LDLIBS) -s -Wl,--subsystem,windows,--out-implib,lib/libsass.a
181
+
182
+ %.o: %.c
183
+ $(CC) $(CFLAGS) -c -o $@ $<
184
+
185
+ %.o: %.rc
186
+ $(WINDRES) -i $< -o $@
187
+
188
+ %.o: %.cpp
189
+ $(CXX) $(CXXFLAGS) -c -o $@ $<
190
+
191
+ %: %.o static
192
+ $(CXX) $(CXXFLAGS) -o $@ $+ $(LDFLAGS) $(LDLIBS)
193
+
194
+ install: install-$(BUILD)
195
+
196
+ install-static: lib/libsass.a
197
+ $(MKDIR) $(DESTDIR)$(PREFIX)\/lib/
198
+ install -pm0755 $< $(DESTDIR)$(PREFIX)/$<
199
+
200
+ install-shared: lib/libsass.so
201
+ $(MKDIR) $(DESTDIR)$(PREFIX)\/lib/
202
+ install -pm0755 $< $(DESTDIR)$(PREFIX)/$<
203
+
204
+ $(SASSC_BIN): $(BUILD)
205
+ cd $(SASS_SASSC_PATH) && $(MAKE)
206
+
207
+ sassc: $(SASSC_BIN)
208
+ $(SASSC_BIN) -v
209
+
210
+ test: $(SASSC_BIN)
211
+ $(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) -s $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)
212
+
213
+ test_build: $(SASSC_BIN)
214
+ $(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) -s --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)
215
+
216
+ test_issues: $(SASSC_BIN)
217
+ $(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues
218
+
219
+ clean:
220
+ $(RM) $(RCOBJECTS) $(COBJECTS) $(OBJECTS) $(LIBRARIES) lib/*.a lib/*.so lib/*.dll lib/*.la
221
+
222
+
223
+ .PHONY: all debug debug-static debug-shared static shared install install-static install-shared sassc clean