demake 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/bin/demake +166 -177
  3. data/lib/apps/example/Makefile +374 -0
  4. data/lib/{data → apps}/example/demake/applications +1 -1
  5. data/lib/apps/example/demake/brief_description +1 -0
  6. data/lib/{data → apps}/example/demake/license +0 -0
  7. data/lib/{data → apps}/example/demake/settings.rb +18 -15
  8. data/lib/apps/example/demake/suggestion +1 -0
  9. data/lib/{data → apps}/example/demake/test-target.rb +0 -0
  10. data/lib/apps/oreo/Makefile +260 -0
  11. data/lib/{data → apps}/oreo/demake/applications +0 -0
  12. data/lib/apps/oreo/demake/brief_description +1 -0
  13. data/lib/{data → apps}/oreo/demake/license +0 -0
  14. data/lib/{data → apps}/oreo/demake/settings.rb +14 -11
  15. data/lib/apps/oreo/demake/suggestion +1 -0
  16. data/lib/{data → apps}/oreo/demake/test-target.rb +0 -0
  17. data/lib/apps/oreo/src/defines.h +29 -0
  18. data/lib/{data → apps}/oreo/src/fast_read_file.h +18 -18
  19. data/lib/{data → apps}/oreo/src/oreo.c +4 -4
  20. data/lib/{data → apps}/oreo/src/typedefs.h +8 -8
  21. data/lib/data/libsrc/auto_bits.h +33 -0
  22. data/lib/data/libsrc/base.h +10 -0
  23. data/lib/data/libsrc/cpu_mark_check.h +267 -0
  24. data/lib/data/libsrc/defines.h +29 -0
  25. data/lib/data/libsrc/fast_read_file.h +259 -0
  26. data/lib/data/libsrc/fast_sha2.h +1840 -0
  27. data/lib/data/libsrc/parse_arguments.h +0 -0
  28. data/lib/data/libsrc/rb_library.c +140 -0
  29. data/lib/data/libsrc/simple_linked_list +0 -0
  30. data/lib/data/libsrc/simple_linked_list.c +36 -0
  31. data/lib/data/libsrc/simple_linked_list.h +91 -0
  32. data/lib/data/libsrc/smart_alloc.h +45 -0
  33. data/lib/data/libsrc/typedefs.h +61 -0
  34. data/lib/template/build_target.rb +0 -0
  35. data/lib/template/clean_target.rb +25 -1
  36. data/lib/template/debug_executable_target.rb +0 -0
  37. data/lib/template/debug_library_target.rb +0 -0
  38. data/lib/template/debug_target.rb +0 -0
  39. data/lib/template/dependency_targets.rb +0 -0
  40. data/lib/template/executable_debug_target.rb +0 -0
  41. data/lib/template/executable_target.rb +0 -0
  42. data/lib/template/generic_dependency_targets.rb +0 -0
  43. data/lib/template/library_debug_target.rb +0 -0
  44. data/lib/template/library_target.rb +0 -0
  45. data/lib/template/license_target.rb +0 -0
  46. data/lib/template/link_library_target.rb +0 -0
  47. data/lib/template/strip_build.rb +0 -0
  48. metadata +39 -20
  49. data/lib/data/oreo/src/defines.h +0 -29
  50. /data/lib/{data → apps}/example/src/goodbye.c +0 -0
  51. /data/lib/{data → apps}/example/src/hello.c +0 -0
  52. /data/lib/{data → apps}/example/src/string/string.c +0 -0
  53. /data/lib/{data → apps}/example/src/string/string.h +0 -0
  54. /data/lib/{data → apps}/oreo/oreo_test.txt +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c692b3025cca8bc958ee0b6af463c3eeee1fed646658db553b53dc7221b2299
4
- data.tar.gz: 2044ed577fe4a9a2c57047dd7704de4659352cd50b0c26640d7c5d11f80e1907
3
+ metadata.gz: 3274ff2579bbe99e1f34dc59d4ea928cc8038f2887299035ce4dd91b48ec1e5f
4
+ data.tar.gz: d3b8bd0a0c724ae6ecf7934fc51ac2d0dabeef510688c864643e6fad63c8dbac
5
5
  SHA512:
6
- metadata.gz: a64ee6bc57ea30cbe1a490659518e0d4633fa2c8e66e4b256ac921b5f3cf0a1de2ec42ba4abdc4c5ffcc1a5874363df6fe82cd7683b42fe27df3a56958a04f3b
7
- data.tar.gz: fbb1cda20f61bbb996f522d2fe2d346fc4733903fb756233e587dd0d552ef1c742d04b09bec67beceb543324b8aa6af21d21631c179374a2463d0abe7bf5e733
6
+ metadata.gz: 19fbd37bdbae3376ff3a3a2b08d1957d849b10d28d166db72b95e08caac6bae7ad77d6bfbcf038344684fa73a781c2eac26d3d49f44db530f75d49c4fd187e64
7
+ data.tar.gz: a12f2d3c0f18888b523332fc3dbfb612236c11a5bce1112fbede19f7123eac5448095f01c89a4982080849de86256579be314ee0bb09218b3d4a3ca587968b95
data/bin/demake CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # demake - Executeable script which uses Ruby to generate decorated make files
3
+ # demake - Executable script which uses Ruby to generate decorated GNU Makefiles
4
4
  # for multiple related applications.
5
5
  #
6
- require 'rbconfig' # Needed by older versions of Ruby
6
+ require 'rbconfig' # Needed by older versions of Ruby
7
7
  require 'pipetext'
8
8
 
9
- demake_version = "0.2.0"
9
+ demake_version = "0.2.2"
10
10
 
11
11
  @silent = false
12
12
  @compiler = "gcc"
@@ -19,9 +19,9 @@ demake_version = "0.2.0"
19
19
  # Raise if you have more cores and a long compile time
20
20
  @num_threads = 8
21
21
 
22
- WIDTH = 75
23
- BOX_WIDTH = WIDTH + "\t@echo".length # To normalize for Makefile format
24
- SHORT_WIDTH = BOX_WIDTH - 8
22
+ WIDTH = 75
23
+ BOX_WIDTH = WIDTH + "\t@echo".length # To normalize for Makefile format
24
+ SHORT_WIDTH = BOX_WIDTH - 8
25
25
 
26
26
  # Where to install binaries / libraries
27
27
  @prefix = "/usr/local/bin/"
@@ -30,8 +30,10 @@ SHORT_WIDTH = BOX_WIDTH - 8
30
30
  # Contains code, does not get touched
31
31
  @source_directory = "src"
32
32
 
33
- # These get completely blown away with make clean
33
+ # These can get completely blown away with make clean
34
+ @clean_includes_binary_directory = false
34
35
  @binary_directory = "bin"
36
+ @clean_includes_library_directory = false
35
37
  @library_directory = "lib"
36
38
  @object_directory = "obj"
37
39
 
@@ -118,121 +120,119 @@ def notify(string)
118
120
  end
119
121
 
120
122
  @lib_data = File.join(File.expand_path("../..", __FILE__), "lib", "data")
123
+ @lib_apps = File.join(File.expand_path("../..", __FILE__), "lib", "apps")
121
124
  @lib_dir = File.join(File.expand_path("../..", __FILE__), "lib")
125
+ @available_apps = Array.new
122
126
 
123
- if(ARGV[0] == "help" || ARGV[0] == "--help" || ARGV[0] == "-h" ||
124
- ARGV[0] == "?" || ARGV[0] == "-?")
125
- program = File.basename($0)
126
- notify("Command syntax:\n\n")
127
- notify("|y#{program}|n - Create or update Makefile\n")
128
- notify("|y#{program} example|n - Create an example application\n")
129
- notify("|y#{program} oreo|n - Create a different sample application\n\n")
130
- exit!
127
+ Dir.entries(@lib_apps).each do |e|
128
+ if(e != '.' && e != '..')
129
+ @available_apps << e
130
+ end
131
131
  end
132
132
 
133
133
  def file_open_write_close(filename, data)
134
- File.open(filename, 'w') do |f|
135
- f.write(data)
134
+ begin
135
+ File.open(filename, 'w') do |f|
136
+ f.write(data)
137
+ end
138
+ rescue
139
+ notify("|RError|n: #{$!}")
136
140
  end
137
141
  end
138
142
 
139
- def file_open_read_close(filename)
143
+ def file_open_read_close(filename, notify_warning=true)
140
144
  data = String.new
141
- File.open(filename, 'r') do |f|
142
- data = f.read
145
+ begin
146
+ File.open(filename, 'r') do |f|
147
+ data = f.read
148
+ end
149
+ rescue
150
+ if(notify_warning == true)
151
+ notify("|YWARNING|n: #{$!.to_s.sub(/@ rb_[a-zA-Z_]* /, '')}")
152
+ end
143
153
  end
144
154
  return(data)
145
155
  end
146
156
 
147
- @example = false
148
- if(ARGV[0] =~ /^example$/)
149
- if(File.directory?('example') == true)
150
- notify("\n#{@emoji_fail}|RError|n: |Ydirectory example |Ralready exists, aborting creation|n\n\n" +
151
- "Delete the directory and try again if you wish to recreate it.\n\n")
152
- exit!
153
- end
154
- @example = true
155
- # Code files used by the example
156
- example_settings_rb = file_open_read_close(@lib_data + '/example/demake/settings.rb')
157
- hello_c = file_open_read_close(@lib_data + '/example/src/hello.c')
158
- goodbye_c = file_open_read_close(@lib_data + '/example/src/goodbye.c')
159
- string_h = file_open_read_close(@lib_data + '/example/src/string/string.h')
160
- string_c = file_open_read_close(@lib_data + '/example/src/string/string.c')
161
- testtarget_rb = file_open_read_close(@lib_data + '/example/demake/test-target.rb')
162
- license = file_open_read_close(@lib_data + '/example/demake/license')
163
-
164
- Dir.mkdir('example')
165
- notify("#{@emoji_success} Created directory: |gexample|n |[open file folder]\n")
166
- Dir.mkdir('example/src')
167
- notify("#{@emoji_success} Created directory: |gexample|n/|gsrc|n |[open file folder]\n")
168
- file_open_write_close('example/src/hello.c', hello_c)
169
- notify("#{@emoji_success} Created file: |gexample|n/|gsrc|n/|yhello.c|n |[page facing up]\n")
170
- file_open_write_close('example/src/goodbye.c', goodbye_c)
171
- notify("#{@emoji_success} Created file: |gexample|n/|gsrc|n/|ygoodbye.c|n |[page facing up]\n")
172
- Dir.mkdir('example/src/string')
173
- notify("#{@emoji_success} Created directory: |gexample|n/|gsrc|n/|gstring|n |[open file folder]\n")
174
- file_open_write_close('example/src/string/string.h', string_h)
175
- notify("#{@emoji_success} Created file: |gexample|n/|gsrc|n/|gstring|n/|ystring.h|n |[page facing up]\n")
176
- file_open_write_close('example/src/string/string.c', string_c)
177
- notify("#{@emoji_success} Created file: |gexample|n/|gsrc|n/|gstring|n/|ystring.c|n |[page facing up]\n")
178
- Dir.mkdir('example/demake')
179
- notify("#{@emoji_success} Created directory: |gexample|n/|gdemake|n |[open file folder]\n")
180
- file_open_write_close('example/demake/applications', "hello string\ngoodbye string\n")
181
- notify("#{@emoji_success} Created file: |gexample|n/|gdemake|n/|yapplications|n |[page facing up]\n")
182
- file_open_write_close('example/demake/settings.rb', example_settings_rb)
183
- notify("#{@emoji_success} Created file: |gexample|n/|gdemake|n/|ysettings.rb|n |[page facing up]\n")
184
- file_open_write_close('example/demake/test-target.rb', testtarget_rb)
185
- notify("#{@emoji_success} Created file: |gexample|n/|gdemake|n/|ytest-target.rb|n |[page facing up]\n")
186
- file_open_write_close('example/demake/license', license)
187
- notify("#{@emoji_success} Created file: |gexample|n/|gdemake|n/|ylicense|n |[page facing up]\n")
188
- Dir.chdir('example')
189
- @working_directory = Dir.pwd
190
- end
191
-
192
- @oreo = false
193
- if(ARGV[0] =~ /^oreo$/)
194
- if(File.directory?('oreo') == true)
195
- notify("\n#{@emoji_fail}|RError|n: |Ydirectory oreo |Ralready exists, aborting creation|n\n\n" +
196
- "Delete the directory and try again if you wish to recreate it.\n\n")
197
- exit!
198
- end
199
- @oreo = true
200
- # Code file used by oreo
201
- oreo_settings_rb = file_open_read_close(@lib_data + '/oreo/demake/settings.rb')
202
- defines_h = file_open_read_close(@lib_data + '/oreo/src/defines.h')
203
- typedefs_h = file_open_read_close(@lib_data + '/oreo/src/typedefs.h')
204
- fast_read_file_h = file_open_read_close(@lib_data + '/oreo/src/fast_read_file.h')
205
- oreo_c = file_open_read_close(@lib_data + '/oreo/src/oreo.c')
206
- testtarget_rb = file_open_read_close(@lib_data + '/oreo/demake/test-target.rb')
207
- oreo_test_txt = file_open_read_close(@lib_data + '/oreo/oreo_test.txt')
208
- license = file_open_read_close(@lib_data + '/oreo/demake/license')
209
-
210
- Dir.mkdir('oreo')
211
- notify("#{@emoji_success} Created directory: |goreo|n |[open file folder]\n")
212
- Dir.mkdir('oreo/src')
213
- notify("#{@emoji_success} Created directory: |goreo|n/|gsrc|n |[open file folder]\n")
214
- file_open_write_close('oreo/src/defines.h', defines_h)
215
- notify("#{@emoji_success} Created file: |goreo|n/|gsrc|n/|ydefines.h|n |[page facing up]\n")
216
- file_open_write_close('oreo/src/typedefs.h', typedefs_h)
217
- notify("#{@emoji_success} Created file: |goreo|n/|gsrc|n/|ytypedefs.h|n |[page facing up]\n")
218
- file_open_write_close('oreo/src/fast_read_file.h', fast_read_file_h)
219
- notify("#{@emoji_success} Created file: |goreo|n/|gsrc|n/|yfast_read_file.h|n |[page facing up]\n")
220
- file_open_write_close('oreo/src/oreo.c', oreo_c)
221
- notify("#{@emoji_success} Created file: |goreo|n/|gsrc|n/|yoreo.c|n |[page facing up]\n")
222
- Dir.mkdir('oreo/demake')
223
- notify("#{@emoji_success} Created directory: |goreo|n/|gdemake|n |[open file folder]\n")
224
- file_open_write_close('oreo/demake/applications', "oreo\n")
225
- notify("#{@emoji_success} Created file: |goreo|n/|gdemake|n/|yapplications|n |[page facing up]\n")
226
- file_open_write_close('oreo/demake/settings.rb', oreo_settings_rb)
227
- notify("#{@emoji_success} Created file: |goreo|n/|gdemake|n/|ysettings.rb|n |[page facing up]\n")
228
- file_open_write_close('oreo/demake/test-target.rb', testtarget_rb)
229
- notify("#{@emoji_success} Created file: |goreo|n/|gdemake|n/|ytest-target.rb|n |[page facing up]\n")
230
- file_open_write_close('oreo/demake/license', license)
231
- notify("#{@emoji_success} Created file: |goreo|n/|gdemake|n/|ylicense|n |[page facing up]\n")
232
- Dir.chdir('oreo')
233
- file_open_write_close('oreo_test.txt', oreo_test_txt)
234
- notify("#{@emoji_success} Created file: |goreo|n/|yoreo_text.txt|n |[page facing up]\n")
235
- @working_directory = Dir.pwd
157
+ def copy_template(filename)
158
+ if(File.directory?(filename) == true)
159
+ new_name = filename.sub(/^#{@lib_apps}./, '')
160
+ begin
161
+ if(File.directory?(new_name) != true)
162
+ Dir.mkdir(new_name)
163
+ notify("#{@emoji_success} Created directory: |g#{new_name}|n |[open file folder]\n")
164
+ end
165
+ Dir.entries(filename).each do |e|
166
+ if(e != '.' && e != '..')
167
+ copy_template(File.join(filename, e))
168
+ end
169
+ end
170
+ rescue Errno::EACCES
171
+ notify("|RError|n: #{$!.to_s.sub(/@ dir_s_mkdir /, '')}")
172
+ exit!
173
+ rescue
174
+ notify("|RError|n: #{$!}")
175
+ exit!
176
+ end
177
+ else
178
+ data = file_open_read_close(filename)
179
+ new_name = filename.sub(/^#{@lib_apps}./, '')
180
+ file_open_write_close(new_name, file_open_read_close(filename))
181
+ notify("#{@emoji_success} Created file: |y#{new_name}|n |[page facing up]\n")
182
+ end
183
+ end
184
+
185
+ @found_application = nil
186
+ @suggestion = String.new
187
+ @available_apps.sort.each do |app|
188
+ if(ARGV[0] =~ /^#{app}$/)
189
+ if(File.directory?(app) == true)
190
+ notify("\n#{@emoji_fail}|RError|n: |Ydirectory #{app} |Ralready exists, aborting creation|n\n\n" +
191
+ "Delete the directory and try again if you wish to recreate it.\n\n")
192
+ exit!
193
+ end
194
+ @found_application = app
195
+ copy_template(File.join(@lib_apps, app))
196
+ begin
197
+ File.open(File.join(@lib_apps, app, 'demake', 'suggestion'), 'r') do |f|
198
+ @suggestion = f.read.chomp
199
+ end
200
+ rescue
201
+ end
202
+ Dir.chdir(app)
203
+ @working_directory = Dir.pwd
204
+ end
205
+ end
206
+
207
+ need_help = false
208
+ if(ARGV[0] == "help" || ARGV[0] == "--help" || ARGV[0] == "-h" ||
209
+ ARGV[0] == "?" || ARGV[0] == "-?")
210
+ need_help = true
211
+ end
212
+ if(need_help == false && ARGV[0] != nil && @found_application == nil)
213
+ notify("Unknown argument: #{ARGV[0]}\n\n")
214
+ need_help = true
215
+ end
216
+ if(need_help == true)
217
+ program = File.basename($0)
218
+ COLUMN_WIDTH = 20
219
+ syntax = "|]#{COLUMN_WIDTH}Command syntax:\n\n" + "|y#{program}|n|; - Create or update Makefile\n"
220
+ @available_apps.sort.each do |app|
221
+ data = String.new
222
+ begin
223
+ File.open(File.join(@lib_apps, app, 'demake', 'brief_description'), 'r') do |f|
224
+ data = f.read.chomp
225
+ end
226
+ rescue
227
+ end
228
+ if(data != "")
229
+ syntax << "|y#{program} #{app}|n|; - #{data}\n"
230
+ else
231
+ syntax << "|y#{program} #{app}|n\n"
232
+ end
233
+ end
234
+ notify(syntax + "\n")
235
+ exit!
236
236
  end
237
237
 
238
238
  @applications = Hash.new
@@ -240,18 +240,11 @@ end
240
240
 
241
241
  # Check for settings / default override
242
242
  begin
243
- if(@example == false && @oreo == false)
244
- code = file_open_read_close('demake/settings.rb')
245
- elsif(@example == true)
246
- code = example_settings_rb
247
- elsif(@oreo == true)
248
- code = oreo_settings_rb
249
- end
243
+ code = file_open_read_close('demake/settings.rb')
250
244
  if(@emojis == false)
251
245
  strip_emojis!(code)
252
246
  end
253
247
  eval code
254
- rescue Errno::ENOENT
255
248
  rescue
256
249
  notify("\n|YWARNING|n: #{$!}\n\n")
257
250
  end
@@ -262,64 +255,57 @@ else
262
255
  @library_extension = '.so'
263
256
  end
264
257
 
265
- if(@example == false && @oreo == false)
266
- # Applications to build
267
- no_applications_file = true
268
- begin
269
- # The expected format is the application followed by a list of its dependencies
270
- # all on the same line separated by space, : or tab and # for comments
271
- application_and_dependencies = file_open_read_close('demake/applications').split(/\n/)
272
- no_applications_file = false
273
- application_and_dependencies.each do |app|
274
- if(app !~ /^#/ && app !~ /^[ \t]*#/)
275
- if(app =~ /([^ :\t]*)[ :\t]*(.*)[ \t]*#?.*/)
276
- application = $1
277
- dependencies = $2.sub(/#.*$/, '').split(/[ :\t]/)
278
- @applications[application] = dependencies
279
- else
280
- @applications[app] = Array.new
281
- end
258
+ # Applications to build
259
+ no_applications_file = true
260
+ begin
261
+ # The expected format is the application followed by a list of its dependencies
262
+ # all on the same line separated by space, : or tab and # for comments
263
+ application_and_dependencies = file_open_read_close('demake/applications').split(/\n/)
264
+ no_applications_file = false
265
+ application_and_dependencies.each do |app|
266
+ if(app !~ /^#/ && app !~ /^[ \t]*#/)
267
+ if(app =~ /([^ :\t]*)[ :\t]*(.*)[ \t]*#?.*/)
268
+ application = $1
269
+ dependencies = $2.sub(/#.*$/, '').split(/[ :\t]/)
270
+ @applications[application] = dependencies
271
+ else
272
+ @applications[app] = Array.new
282
273
  end
283
274
  end
284
- rescue
285
275
  end
276
+ rescue
277
+ end
286
278
 
287
- # Libraries to build
288
- no_libraries_file = true
289
- begin
290
- # The expected format is the application followed by a list of its dependencies
291
- # all on the same line separated by space, : or tab and # for comments
292
- libraries_and_dependencies = file_open_read_close('demake/libraries').split(/\n/)
293
- no_libraries_file = false
294
- libraries_and_dependencies.each do |lib|
295
- if(lib !~ /^#/ && lib !~ /^[ \t]*#/)
296
- if(lib =~ /([^ :\t]*)[ :\t]*(.*)[ \t]*#?.*/)
297
- library = $1
298
- dependencies = $2.sub(/#.*$/, '').split(/[ :\t]/)
299
- @build_libraries[library] = dependencies
300
- else
301
- @build_libraries[lib] = Array.new
302
- end
279
+ # Libraries to build
280
+ no_libraries_file = true
281
+ begin
282
+ # The expected format is the application followed by a list of its dependencies
283
+ # all on the same line separated by space, : or tab and # for comments
284
+ libraries_and_dependencies = file_open_read_close('demake/libraries', false).split(/\n/)
285
+ no_libraries_file = false
286
+ libraries_and_dependencies.each do |lib|
287
+ if(lib !~ /^#/ && lib !~ /^[ \t]*#/)
288
+ if(lib =~ /([^ :\t]*)[ :\t]*(.*)[ \t]*#?.*/)
289
+ library = $1
290
+ dependencies = $2.sub(/#.*$/, '').split(/[ :\t]/)
291
+ @build_libraries[library] = dependencies
292
+ else
293
+ @build_libraries[lib] = Array.new
303
294
  end
304
295
  end
305
- rescue
306
296
  end
307
- if(no_applications_file && no_libraries_file)
308
- notify("\n#{@emoji_fail}|RError|n: |Yapplications file|n |Rdoes not exist|n\n\n" +
309
- "You must create a file named |Yapplications|n which contains a list of\n" +
310
- "executeable application names and any dependencies to be compiled.\n\n")
311
- exit!
312
- elsif(@applications == {} && @build_libraries == {})
313
- notify("\n#{@emoji_fail}|RError|n: |Yapplications file|n |Rcannot be empty|n\n\n" +
314
- "You must create a file named |Yapplications|n which contains a list of\n" +
315
- "executeable application names and any dependencies to be compiled.\n\n")
316
- exit!
317
- end
318
- elsif(@oreo == true)
319
- @applications['oreo'] = Array.new
320
- elsif(@example == true)
321
- @applications['hello'] = ['string']
322
- @applications['goodbye'] = ['string']
297
+ rescue
298
+ end
299
+ if(no_applications_file && no_libraries_file)
300
+ notify("\n#{@emoji_fail}|RError|n: |Yapplications file|n |Rdoes not exist|n\n\n" +
301
+ "You must create a file named |Yapplications|n which contains a list of\n" +
302
+ "executable application names and any dependencies to be compiled.\n\n")
303
+ exit!
304
+ elsif(@applications == {} && @build_libraries == {})
305
+ notify("\n#{@emoji_fail}|RError|n: |Yapplications file|n |Rcannot be empty|n\n\n" +
306
+ "You must create a file named |Yapplications|n which contains a list of\n" +
307
+ "executable application names and any dependencies to be compiled.\n\n")
308
+ exit!
323
309
  end
324
310
 
325
311
  @output = <<-END_OF_STRING
@@ -915,7 +901,10 @@ install : #{LICENSE}
915
901
  \t@echo "#{@emoji_install} Starting install..."
916
902
  END_OF_STRING
917
903
  begin
918
- code = file_open_read_close('demake/install-target.rb')
904
+ code = String.new
905
+ File.open('demake/install-target.rb', 'r') do |f|
906
+ code = f.read
907
+ end
919
908
  if(@emojis == false)
920
909
  strip_emojis!(code)
921
910
  end
@@ -956,7 +945,10 @@ uninstall :
956
945
  \t@echo "#{@emoji_uninstall} Starting uninstall..."
957
946
  END_OF_STRING
958
947
  begin
959
- code = file_open_read_close('demake/uninstall-target.rb')
948
+ code = String.new
949
+ File.open('demake/uninstall-target.rb', 'r') do |f|
950
+ code = f.read
951
+ end
960
952
  if(@emojis == false)
961
953
  strip_emojis!(code)
962
954
  end
@@ -971,14 +963,11 @@ if(@emojis == false)
971
963
  end
972
964
  @output << "\n" + @pipe.pipetext(uninstall_target)
973
965
 
974
- if(@example || @oreo)
966
+ if(@found_application != nil)
975
967
  File.open('Makefile', 'w').write(@output)
976
- if(@example)
977
- notify("#{@emoji_success} Created file: |gexample|n/|yMakefile|n |[page facing up]\n\n" +
978
- "Suggestion: |Ccd example ; make ; make build ; make test|n\n")
979
- elsif(@oreo)
980
- notify("#{@emoji_success} Created file: |goreo|n/|yMakefile|n |[page facing up]\n\n" +
981
- "Suggestion: |Ccd oreo ; make ; make build ; make test|n\n")
968
+ notify("#{@emoji_success} Created file: |y#{@found_application}/Makefile|n |[page facing up]\n\n")
969
+ if(@suggestion != "")
970
+ notify("Suggestion: |C#{@suggestion}|n\n")
982
971
  end
983
972
  Dir.chdir('..')
984
973
  else