|
22 | 22 |
|
23 | 23 |
|
24 | 24 | MAKEFILE_SOURCES_LIST_RE = re.compile(r''' |
25 | | - (?: ^ | \n ) libsass_la_SOURCES [ \t]* = [ \t]* |
| 25 | + (?: ^ | \n ) (?: libsass_la_ )? SOURCES [ \t]* = [ \t]* |
26 | 26 | (?P<sources> (?: (?: $ | [ \t] | \\ [\n] )+ |
27 | 27 | [^ \n\t\\]+ )+ ) |
28 | 28 | ''', re.VERBOSE) |
29 | 29 |
|
30 | 30 |
|
31 | | -with open('Makefile.am') as makefile: |
32 | | - sources_match = MAKEFILE_SOURCES_LIST_RE.search(makefile.read()) |
33 | | - sources_list = sources_match.group('sources').replace('\\\n', ' ') |
34 | | - libsass_sources = sources_list.split() |
| 31 | +libsass_sources = set() |
| 32 | +for makefilename in 'Makefile', 'Makefile.am': |
| 33 | + with open(makefilename) as makefile: |
| 34 | + sources_match = MAKEFILE_SOURCES_LIST_RE.search(makefile.read()) |
| 35 | + sources_list = sources_match.group('sources').replace('\\\n', ' ') |
| 36 | + libsass_sources.update(sources_list.split()) |
| 37 | +libsass_sources = list(libsass_sources) |
35 | 38 |
|
36 | 39 | libsass_headers = [ |
37 | 40 | 'sass_interface.h', 'sass.h', 'win32/unistd.h' |
38 | 41 | ] |
39 | 42 | libsass_headers.extend(glob.glob('*.hpp')) |
40 | 43 | include_dirs = ['sass2scss'] |
41 | | -sources = ['pysass.c', 'sass2scss/sass2scss.cpp'] |
| 44 | +sources = ['pysass.c'] |
42 | 45 | sources.extend(libsass_sources) |
43 | 46 |
|
44 | 47 | if sys.platform == 'win32': |
@@ -158,7 +161,10 @@ def run(self): |
158 | 161 | packages=['sassutils'], |
159 | 162 | py_modules=['sass', 'sassc', 'sasstests'], |
160 | 163 | package_data={ |
161 | | - '': ['README.rst', 'Makefile.am', 'win32/*.h', 'test/*.sass'] |
| 164 | + '': [ |
| 165 | + 'README.rst', 'Makefile', 'Makefile.am', |
| 166 | + 'win32/*.h', 'test/*.sass' |
| 167 | + ] |
162 | 168 | }, |
163 | 169 | scripts=['sassc.py'], |
164 | 170 | license='MIT License', |
|
0 commit comments