File: fixmpw.sh

package info (click to toggle)
allegro4 2%3A4.0.1-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 17,052 kB
  • ctags: 12,972
  • sloc: ansic: 109,525; asm: 16,672; cpp: 3,221; sh: 1,761; makefile: 556; pascal: 105; perl: 73
file content (73 lines) | stat: -rwxr-xr-x 1,862 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#          ______   ___    ___
#         /\  _  \ /\_ \  /\_ \
#         \ \ \L\ \\//\ \ \//\ \      __     __   _ __   ___ 
#          \ \  __ \ \ \ \  \ \ \   /'__`\ /'_ `\/\`'__\/ __`\
#           \ \ \/\ \ \_\ \_ \_\ \_/\  __//\ \L\ \ \ \//\ \L\ \
#            \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
#             \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
#                                            /\____/
#                                            \_/__/
# 
#       MPW Script install allegro.
# 
#       By Ronaldo Hideki Yamada.
#  
#       See readme.txt for copyright information.
#
#       See readme.mpw for information about use of this file.
#

Set savedir `Directory`

If "{0}" =~ /(:)1readme.mpw/
	SetDirectory {1}
End

If "{Allegro}"!="{Libraries}::Allegro:"
	Echo "### Allegro var not defined correctly"
	Echo "### If required quit MPW after install"
	Set -e Allegro {Libraries}::Allegro:
End

If !`Exists "{MPW}Startup Items:setalleg.sh"`
   Echo "### Please quit MPW after install"
   Echo 'Set -e Allegro {Libraries}::Allegro:' > "{MPW}Startup Items:setalleg.sh"
End

Duplicate -y ":tools:datedit.h" ":tools:plugins:../datedit.h"

If !`Exists "{Allegro}"`
	NewFolder "{Allegro}"	
End
If !`Exists ":obj:"`
	NewFolder ":obj:"	
End
If !`Exists ":obj:mpw:"`
	NewFolder ":obj:mpw:"
End
If !`Exists ":obj:mpw:alld:"`
	NewFolder ":obj:mpw:alld:"
End

If !`Exists "{Allegro}allegro/alplatf.h"`
    Echo '/* generated by fixmpw.sh */' > "{Allegro}allegro/alplatf.h"
    Echo '#define ALLEGRO_MPW' >> "{Allegro}allegro/alplatf.h"
End

#change creator to MPW Shell
set f "`Files -r -f -t 'TEXT' -c 'CWIE' -o`"
if "{f}"!=""
	SetFile -c 'MPS ' {f}
end
unset f

If `Exists "makefile.mpw"`
    Duplicate -y makefile.mpw makefile
	BuildProgram all
Else
	Echo "makefile.mpw not found"
End

Echo "### Done"

SetDirectory "{savedir}"