summaryrefslogtreecommitdiff
path: root/src/fpmake.pas
blob: 80e0be3d69132ae12b2c4c970fe29e14c500cb14 (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
    fpGUI  -  Free Pascal GUI Toolkit

    Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this
    distribution, for details of the copyright.

    See the file COPYING.modifiedLGPL, included in this distribution,
    for details about redistributing fpGUI.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    Description:
      This program is kindly supplied by Henry Vermaak. It uses the new
      fpmake build system introduced in FPC 2.2.2. fpmake is supposed to
      replace the Makefile build system.

    Usage:
      - Compile fpmake.pas as follows:
             fpc fpmake.pas

      - To find out more about what fpmake can do and see some help
             fpmake --help

      - Build and install fpGUI
             fpmake install

        Note that if you installed FPC in a non-standard location on you
        system you need to tell fpmake which compiler and units to use. The
        following is all in one line:
             fpmake.exe -r c:\fpc\2.2.3\bin\i386-win32\ppc386.exe
                -UG c:\fpc\2.2.3\units\i386-win32
          or
             ./fpmake -v build -UG /opt/fpc/lib/fpc/2.2.3/units/i386-linux/
}

program fpmake;

{$mode objfpc}
{$h+}

uses sysutils, fpmkunit;

var
  T: TTarget;
  P: TPackage;
begin
  with Installer do begin
    P := AddPackage('fpgui');
    P.Version := '0.6_svn';
    { Fill in more package details here }

    { This shouldn't really be here.  fpmake will install to the local
      fpc installation, i.e. /usr/[local]/lib/fpc/<version>/units/<cpu-os>/fpgui
      if we set the package name to fpgui as above.  This base install dir
      can be overridden by passing -B to fpmake.  The line below will cause
      the units to be output in ../lib/<cpu-os>/fpgui  }
    Defaults.UnitInstallDir := Format('../lib/%s-%s/', [CurrentCPU, CurrentOS]);

    { If you installed FPC to a non-standard location, you need to specify
      where fpmake can find the compiler and RTL units. You can pass that
      information via the command line to fpmake, or specify it here in code. }
//    if Defaults.OS in AllUnixOSes then
//      Defaults.GlobalUnitDir := Format('/opt/fpc/lib/fpc/2.2.3/units/%s-%s/', [CurrentCPU, CurrentOS])
//    else
//      Defaults.GlobalUnitDir := Format('c:\fpc\2.2.3\units\%s-%s', [CurrentCPU, CurrentOS]);

    if Defaults.OS in AllUnixOSes
      then Defaults.Options := Defaults.Options + '-dX11'
      else Defaults.Options := Defaults.Options + '-dGDI';

    P.SourcePath.Add('corelib');
    P.SourcePath.Add('corelib/x11', AllUnixOSes);
    P.SourcePath.Add('corelib/gdi', AllWindowsOSes);
    P.SourcePath.Add('gui');
    P.SourcePath.Add('gui/db');

    P.UnitPath.Add('corelib');
    P.UnitPath.Add('corelib/x11', AllUnixOSes);
    P.UnitPath.Add('corelib/gdi', AllWindowsOSes);
    P.UnitPath.Add('gui');
    P.UnitPath.Add('gui/db');

    P.IncludePath.Add('corelib');
    P.IncludePath.Add('corelib/x11', AllUnixOSes);
    P.IncludePath.Add('corelib/gdi', AllWindowsOSes);
    P.IncludePath.Add('gui');

    { todo: add unit and include dependency for all }

    { x11 and gdi common }
    T := P.Targets.AddUnit('fpg_impl.pas');

    { corelib/x11 }
    T := P.Targets.AddUnit('fpg_keyconv_x11.pas', AllUnixOSes);
    T := P.Targets.AddUnit('fpg_netlayer_x11.pas', AllUnixOSes);
    T := P.Targets.AddUnit('fpg_x11.pas', AllUnixOSes);
{    with T.Dependencies do begin
      AddUnit('fpg_xft_x11');
      AddUnit('fpg_netlayer_x11');
      AddUnit('fpg_base');
      AddUnit('fpg_impl');
    end;  }
    T := P.Targets.AddUnit('fpg_xft_x11.pas', AllUnixOSes);

    { corelib/gdi }
    T := P.Targets.AddUnit('fpg_gdi.pas', AllWindowsOSes);

    { corelib }
    T := P.Targets.AddUnit('fpg_base.pas');
    T := P.Targets.AddUnit('fpg_imagelist.pas');
    T := P.Targets.AddUnit('fpg_popupwindow.pas');
    T := P.Targets.AddUnit('fpg_translations.pas');
    T := P.Targets.AddUnit('fpg_cmdlineparams.pas');
    T := P.Targets.AddUnit('fpg_imgfmt_bmp.pas');
    T := P.Targets.AddUnit('fpg_stdimages.pas');
    T := P.Targets.AddUnit('fpg_utils.pas');
    T := P.Targets.AddUnit('fpg_command_intf.pas');
    T := P.Targets.AddUnit('fpg_main.pas');
    T := P.Targets.AddUnit('fpg_stringhashlist.pas');
    T := P.Targets.AddUnit('fpg_widget.pas');
    T := P.Targets.AddUnit('fpg_constants.pas');
      T.ResourceStrings := True;
    T := P.Targets.AddUnit('fpg_strings.pas');
    T := P.Targets.AddUnit('fpg_wuline.pas');
    T := P.Targets.AddUnit('fpg_extinterpolation.pas');
    T := P.Targets.AddUnit('fpg_pofiles.pas');
    T := P.Targets.AddUnit('fpg_stringutils.pas');

    { gui/db }
    T := P.Targets.AddUnit('fpgui_db.pas');

    { gui }
    T := P.Targets.AddUnit('fpg_animation.pas');
    T := P.Targets.AddUnit('fpg_combobox.pas');
    T := P.Targets.AddUnit('fpg_edit.pas');
    T := P.Targets.AddUnit('fpg_hint.pas');
    T := P.Targets.AddUnit('fpg_listbox.pas');
    T := P.Targets.AddUnit('fpg_mru.pas');
    T := P.Targets.AddUnit('fpg_radiobutton.pas');
    T := P.Targets.AddUnit('fpg_tab.pas');
    T := P.Targets.AddUnit('fpg_basegrid.pas');
    T := P.Targets.AddUnit('fpg_customgrid.pas');
    T := P.Targets.AddUnit('fpg_form.pas');
    T := P.Targets.AddUnit('fpg_hyperlink.pas');
    T := P.Targets.AddUnit('fpg_listview.pas');
    T := P.Targets.AddUnit('fpg_panel.pas');
    T := P.Targets.AddUnit('fpg_scrollbar.pas');
    T := P.Targets.AddUnit('fpg_trackbar.pas');
    T := P.Targets.AddUnit('fpg_button.pas');
    T := P.Targets.AddUnit('fpg_dialogs.pas');
    T := P.Targets.AddUnit('fpg_gauge.pas');
    T := P.Targets.AddUnit('fpg_iniutils.pas');
    T := P.Targets.AddUnit('fpg_memo.pas');
    T := P.Targets.AddUnit('fpg_popupcalendar.pas');
    T := P.Targets.AddUnit('fpg_splitter.pas');
    T := P.Targets.AddUnit('fpg_tree.pas');
    T := P.Targets.AddUnit('fpg_checkbox.pas');
    T := P.Targets.AddUnit('fpg_editcombo.pas');
    T := P.Targets.AddUnit('fpg_grid.pas');
    T := P.Targets.AddUnit('fpg_label.pas');
    T := P.Targets.AddUnit('fpg_menu.pas');
    T := P.Targets.AddUnit('fpg_progressbar.pas');
    T := P.Targets.AddUnit('fpg_style.pas');

    Run;
  end;
end.