| 227 |
dpurdie |
1 |
# Copyright (C) 1998-2004 ERG Limited, All rights reserved
|
|
|
2 |
#
|
|
|
3 |
# Module name : Makefile.pl
|
|
|
4 |
# Module type : Makefile system
|
|
|
5 |
# Compiler(s) : ANSI C
|
|
|
6 |
# Environment(s): n/a
|
|
|
7 |
#
|
|
|
8 |
# Description: makefile.pl template example
|
|
|
9 |
#
|
|
|
10 |
#.........................................................................#
|
|
|
11 |
|
|
|
12 |
die "Usage: Makefile.pl rootdir Makelib.pl\n"
|
|
|
13 |
unless( $#ARGV+1 >= 2 );
|
|
|
14 |
require "$ARGV[1]";
|
|
|
15 |
|
|
|
16 |
# subdirectories to recurse (if any) and target platform(s),
|
|
|
17 |
# the following section(s) is called for each target ..
|
|
|
18 |
#
|
|
|
19 |
# eg. Rules();
|
|
|
20 |
# SubDir('SubDir1', 'SubDir2');
|
|
|
21 |
# Platform( 'WIN32', 'MOS68K', 'MOSCF' );
|
|
|
22 |
|
|
|
23 |
#
|
|
|
24 |
# Build platform definitions ..
|
|
|
25 |
#
|
|
|
26 |
Platform( '*' );
|
|
|
27 |
|
|
|
28 |
#
|
|
|
29 |
# Specify directories to search to locate source and header files
|
|
|
30 |
#
|
|
|
31 |
AddDir ( '*', "$ProjectBase/common" );
|
|
|
32 |
AddIncDir ( '*', "$ProjectBase/include" );
|
|
|
33 |
|
|
|
34 |
############################################################################
|
|
|
35 |
# Define the source files
|
|
|
36 |
#
|
|
|
37 |
AddSrcDir ( '*' , "src" );
|
|
|
38 |
AddDir ( '*' , "inc" );
|
|
|
39 |
Src ( '*' , "source1.c" );
|
|
|
40 |
Src ( '*' , "source2.c" );
|
|
|
41 |
Src ( 'WIN' , "win_source.c" );
|
|
|
42 |
Src ( 'MOS' , "mos_source.c" );
|
|
|
43 |
Src ( '*', "MyApi.h" );
|
|
|
44 |
|
|
|
45 |
#
|
|
|
46 |
# Build and install the library
|
|
|
47 |
Lib ( '*' , "MyPackage", @OBJS );
|
|
|
48 |
InstallLib ( '*' , "MyPackage" );
|
|
|
49 |
InstallHdr ( '*' , @CHDRS ,"--Strip" );
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
#.............................................................................
|
|
|
53 |
# Packaging definitions
|
|
|
54 |
#
|
|
|
55 |
|
|
|
56 |
PackageHdr ( '*', @CHDRS ,"--Strip" );
|
|
|
57 |
PackageLib ( '*', @LIBS );
|
|
|
58 |
|
|
|
59 |
#..
|
|
|
60 |
#
|
|
|
61 |
PackageFile ( '*' , 'descpkg' );
|
|
|
62 |
|
|
|
63 |
#.............................................................................
|
|
|
64 |
# Finally generate the makefile
|
|
|
65 |
#
|
|
|
66 |
MakefileGenerate();
|
|
|
67 |
|
|
|
68 |
#.. Successful termination
|
|
|
69 |
1;
|
|
|
70 |
|