File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -133,18 +133,22 @@ def make(env, target)
133133archive_target = "build/libprism.a"
134134archive_path = File . expand_path ( "../../#{ archive_target } " , __dir__ )
135135
136- make ( env , archive_target ) unless File . exist? ( archive_path )
137- $LOCAL_LIBS << " #{ archive_path } "
136+ def src_list ( path )
137+ srcdir = path . dup
138+ RbConfig . expand ( srcdir ) # mutates srcdir :-/
139+ Dir [ File . join ( srcdir , "*.{#{ SRC_EXT . join ( %q{,} ) } }" ) ]
140+ end
141+
142+ $srcs = src_list ( "$(srcdir)" )
143+
144+ def add_libprism_source ( path )
145+ $VPATH << path
146+ src_list path
147+ end
148+
149+ $srcs. concat add_libprism_source ( "$(srcdir)/../../src" )
150+ $srcs. concat add_libprism_source ( "$(srcdir)/../../src/util" )
138151
139152# Finally, we'll create the `Makefile` that is going to be used to configure and
140153# build the C extension.
141154create_makefile ( "prism/prism" )
142-
143- # Now that the `Makefile` for the C extension is built, we'll append on an extra
144- # rule that dictates that the extension should be rebuilt if the archive is
145- # updated.
146- File . open ( "Makefile" , "a" ) do |mf |
147- mf . puts
148- mf . puts ( "# Automatically rebuild the extension if libprism.a changed" )
149- mf . puts ( "$(TARGET_SO): $(LOCAL_LIBS)" )
150- end
You can’t perform that action at this time.
0 commit comments