demake 0.2.0 → 0.2.1

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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/bin/demake +163 -176
  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 +14 -14
  8. data/lib/apps/example/demake/suggestion +1 -0
  9. data/lib/{data → apps}/example/demake/test-target.rb +0 -0
  10. data/lib/{data → apps}/example/src/goodbye.c +0 -0
  11. data/lib/{data → apps}/example/src/hello.c +0 -0
  12. data/lib/{data → apps}/example/src/string/string.c +0 -0
  13. data/lib/{data → apps}/example/src/string/string.h +0 -0
  14. data/lib/apps/oreo/Makefile +260 -0
  15. data/lib/{data → apps}/oreo/demake/applications +0 -0
  16. data/lib/apps/oreo/demake/brief_description +1 -0
  17. data/lib/{data → apps}/oreo/demake/license +0 -0
  18. data/lib/{data → apps}/oreo/demake/settings.rb +13 -13
  19. data/lib/apps/oreo/demake/suggestion +1 -0
  20. data/lib/{data → apps}/oreo/demake/test-target.rb +0 -0
  21. data/lib/apps/oreo/src/defines.h +29 -0
  22. data/lib/{data → apps}/oreo/src/fast_read_file.h +18 -18
  23. data/lib/{data → apps}/oreo/src/oreo.c +4 -4
  24. data/lib/{data → apps}/oreo/src/typedefs.h +8 -8
  25. data/lib/data/libsrc/auto_bits.h +33 -0
  26. data/lib/data/libsrc/base.h +10 -0
  27. data/lib/data/libsrc/cpu_mark_check.h +267 -0
  28. data/lib/data/libsrc/defines.h +29 -0
  29. data/lib/data/libsrc/fast_read_file.h +259 -0
  30. data/lib/data/libsrc/fast_sha2.h +1840 -0
  31. data/lib/data/libsrc/parse_arguments.h +0 -0
  32. data/lib/data/libsrc/rb_library.c +140 -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 +0 -0
  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 +35 -20
  49. data/lib/data/oreo/src/defines.h +0 -29
  50. /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: 0dc09a132635560049c925c2abcdff0afc64a4e60b03de5f26da26ada3f2e084
4
+ data.tar.gz: 5742dfdd893a1fefc6e7d559b68227bc4f8009d11aa512f80872b3591043a3f0
5
5
  SHA512:
6
- metadata.gz: a64ee6bc57ea30cbe1a490659518e0d4633fa2c8e66e4b256ac921b5f3cf0a1de2ec42ba4abdc4c5ffcc1a5874363df6fe82cd7683b42fe27df3a56958a04f3b
7
- data.tar.gz: fbb1cda20f61bbb996f522d2fe2d346fc4733903fb756233e587dd0d552ef1c742d04b09bec67beceb543324b8aa6af21d21631c179374a2463d0abe7bf5e733
6
+ metadata.gz: 8ecb2ab96a2e9e486d090e9f1e47ec16de7c91ad4b0f5ae4238b82c951d7a0cfe749fa61f03a0e6c03e5ac9711579d92e29788dfe06411eaba6cf054603c7e6b
7
+ data.tar.gz: 3d8264dae828999e98a93b6816dd9b16ebbbc466bb67fc91ca2d3d61e044ab1df4aa44cb5dec584e59d98361579828ca8c452d2353ef63fee1d398f8739433e6
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.1"
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/"
@@ -118,121 +118,119 @@ def notify(string)
118
118
  end
119
119
 
120
120
  @lib_data = File.join(File.expand_path("../..", __FILE__), "lib", "data")
121
+ @lib_apps = File.join(File.expand_path("../..", __FILE__), "lib", "apps")
121
122
  @lib_dir = File.join(File.expand_path("../..", __FILE__), "lib")
123
+ @available_apps = Array.new
122
124
 
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!
125
+ Dir.entries(@lib_apps).each do |e|
126
+ if(e != '.' && e != '..')
127
+ @available_apps << e
128
+ end
131
129
  end
132
130
 
133
131
  def file_open_write_close(filename, data)
134
- File.open(filename, 'w') do |f|
135
- f.write(data)
132
+ begin
133
+ File.open(filename, 'w') do |f|
134
+ f.write(data)
135
+ end
136
+ rescue
137
+ notify("|RError|n: #{$!}")
136
138
  end
137
139
  end
138
140
 
139
- def file_open_read_close(filename)
141
+ def file_open_read_close(filename, notify_warning=true)
140
142
  data = String.new
141
- File.open(filename, 'r') do |f|
142
- data = f.read
143
+ begin
144
+ File.open(filename, 'r') do |f|
145
+ data = f.read
146
+ end
147
+ rescue
148
+ if(notify_warning == true)
149
+ notify("|YWARNING|n: #{$!.to_s.sub(/@ rb_[a-zA-Z_]* /, '')}")
150
+ end
143
151
  end
144
152
  return(data)
145
153
  end
146
154
 
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
155
+ def copy_template(filename)
156
+ if(File.directory?(filename) == true)
157
+ new_name = filename.sub(/^#{@lib_apps}./, '')
158
+ begin
159
+ if(File.directory?(new_name) != true)
160
+ Dir.mkdir(new_name)
161
+ notify("#{@emoji_success} Created directory: |g#{new_name}|n |[open file folder]\n")
162
+ end
163
+ Dir.entries(filename).each do |e|
164
+ if(e != '.' && e != '..')
165
+ copy_template(File.join(filename, e))
166
+ end
167
+ end
168
+ rescue Errno::EACCES
169
+ notify("|RError|n: #{$!.to_s.sub(/@ dir_s_mkdir /, '')}")
170
+ exit!
171
+ rescue
172
+ notify("|RError|n: #{$!}")
173
+ exit!
174
+ end
175
+ else
176
+ data = file_open_read_close(filename)
177
+ new_name = filename.sub(/^#{@lib_apps}./, '')
178
+ file_open_write_close(new_name, file_open_read_close(filename))
179
+ notify("#{@emoji_success} Created file: |y#{new_name}|n |[page facing up]\n")
180
+ end
181
+ end
182
+
183
+ @found_application = nil
184
+ @suggestion = String.new
185
+ @available_apps.sort.each do |app|
186
+ if(ARGV[0] =~ /^#{app}$/)
187
+ if(File.directory?(app) == true)
188
+ notify("\n#{@emoji_fail}|RError|n: |Ydirectory #{app} |Ralready exists, aborting creation|n\n\n" +
189
+ "Delete the directory and try again if you wish to recreate it.\n\n")
190
+ exit!
191
+ end
192
+ @found_application = app
193
+ copy_template(File.join(@lib_apps, app))
194
+ begin
195
+ File.open(File.join(@lib_apps, app, 'demake', 'suggestion'), 'r') do |f|
196
+ @suggestion = f.read.chomp
197
+ end
198
+ rescue
199
+ end
200
+ Dir.chdir(app)
201
+ @working_directory = Dir.pwd
202
+ end
203
+ end
204
+
205
+ need_help = false
206
+ if(ARGV[0] == "help" || ARGV[0] == "--help" || ARGV[0] == "-h" ||
207
+ ARGV[0] == "?" || ARGV[0] == "-?")
208
+ need_help = true
209
+ end
210
+ if(need_help == false && ARGV[0] != nil && @found_application == nil)
211
+ notify("Unknown argument: #{ARGV[0]}\n\n")
212
+ need_help = true
213
+ end
214
+ if(need_help == true)
215
+ program = File.basename($0)
216
+ COLUMN_WIDTH = 20
217
+ syntax = "|]#{COLUMN_WIDTH}Command syntax:\n\n" + "|y#{program}|n|; - Create or update Makefile\n"
218
+ @available_apps.sort.each do |app|
219
+ data = String.new
220
+ begin
221
+ File.open(File.join(@lib_apps, app, 'demake', 'brief_description'), 'r') do |f|
222
+ data = f.read.chomp
223
+ end
224
+ rescue
225
+ end
226
+ if(data != "")
227
+ syntax << "|y#{program} #{app}|n|; - #{data}\n"
228
+ else
229
+ syntax << "|y#{program} #{app}|n\n"
230
+ end
231
+ end
232
+ notify(syntax + "\n")
233
+ exit!
236
234
  end
237
235
 
238
236
  @applications = Hash.new
@@ -240,18 +238,11 @@ end
240
238
 
241
239
  # Check for settings / default override
242
240
  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
241
+ code = file_open_read_close('demake/settings.rb')
250
242
  if(@emojis == false)
251
243
  strip_emojis!(code)
252
244
  end
253
245
  eval code
254
- rescue Errno::ENOENT
255
246
  rescue
256
247
  notify("\n|YWARNING|n: #{$!}\n\n")
257
248
  end
@@ -262,64 +253,57 @@ else
262
253
  @library_extension = '.so'
263
254
  end
264
255
 
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
256
+ # Applications to build
257
+ no_applications_file = true
258
+ begin
259
+ # The expected format is the application followed by a list of its dependencies
260
+ # all on the same line separated by space, : or tab and # for comments
261
+ application_and_dependencies = file_open_read_close('demake/applications').split(/\n/)
262
+ no_applications_file = false
263
+ application_and_dependencies.each do |app|
264
+ if(app !~ /^#/ && app !~ /^[ \t]*#/)
265
+ if(app =~ /([^ :\t]*)[ :\t]*(.*)[ \t]*#?.*/)
266
+ application = $1
267
+ dependencies = $2.sub(/#.*$/, '').split(/[ :\t]/)
268
+ @applications[application] = dependencies
269
+ else
270
+ @applications[app] = Array.new
282
271
  end
283
272
  end
284
- rescue
285
273
  end
274
+ rescue
275
+ end
286
276
 
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
277
+ # Libraries to build
278
+ no_libraries_file = true
279
+ begin
280
+ # The expected format is the application followed by a list of its dependencies
281
+ # all on the same line separated by space, : or tab and # for comments
282
+ libraries_and_dependencies = file_open_read_close('demake/libraries', false).split(/\n/)
283
+ no_libraries_file = false
284
+ libraries_and_dependencies.each do |lib|
285
+ if(lib !~ /^#/ && lib !~ /^[ \t]*#/)
286
+ if(lib =~ /([^ :\t]*)[ :\t]*(.*)[ \t]*#?.*/)
287
+ library = $1
288
+ dependencies = $2.sub(/#.*$/, '').split(/[ :\t]/)
289
+ @build_libraries[library] = dependencies
290
+ else
291
+ @build_libraries[lib] = Array.new
303
292
  end
304
293
  end
305
- rescue
306
294
  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']
295
+ rescue
296
+ end
297
+ if(no_applications_file && no_libraries_file)
298
+ notify("\n#{@emoji_fail}|RError|n: |Yapplications file|n |Rdoes not exist|n\n\n" +
299
+ "You must create a file named |Yapplications|n which contains a list of\n" +
300
+ "executable application names and any dependencies to be compiled.\n\n")
301
+ exit!
302
+ elsif(@applications == {} && @build_libraries == {})
303
+ notify("\n#{@emoji_fail}|RError|n: |Yapplications file|n |Rcannot be empty|n\n\n" +
304
+ "You must create a file named |Yapplications|n which contains a list of\n" +
305
+ "executable application names and any dependencies to be compiled.\n\n")
306
+ exit!
323
307
  end
324
308
 
325
309
  @output = <<-END_OF_STRING
@@ -915,7 +899,10 @@ install : #{LICENSE}
915
899
  \t@echo "#{@emoji_install} Starting install..."
916
900
  END_OF_STRING
917
901
  begin
918
- code = file_open_read_close('demake/install-target.rb')
902
+ code = String.new
903
+ File.open('demake/install-target.rb', 'r') do |f|
904
+ code = f.read
905
+ end
919
906
  if(@emojis == false)
920
907
  strip_emojis!(code)
921
908
  end
@@ -956,7 +943,10 @@ uninstall :
956
943
  \t@echo "#{@emoji_uninstall} Starting uninstall..."
957
944
  END_OF_STRING
958
945
  begin
959
- code = file_open_read_close('demake/uninstall-target.rb')
946
+ code = String.new
947
+ File.open('demake/uninstall-target.rb', 'r') do |f|
948
+ code = f.read
949
+ end
960
950
  if(@emojis == false)
961
951
  strip_emojis!(code)
962
952
  end
@@ -971,14 +961,11 @@ if(@emojis == false)
971
961
  end
972
962
  @output << "\n" + @pipe.pipetext(uninstall_target)
973
963
 
974
- if(@example || @oreo)
964
+ if(@found_application != nil)
975
965
  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")
966
+ notify("#{@emoji_success} Created file: |y#{@found_application}/Makefile|n |[page facing up]\n\n")
967
+ if(@suggestion != "")
968
+ notify("Suggestion: |C#{@suggestion}|n\n")
982
969
  end
983
970
  Dir.chdir('..')
984
971
  else