Subversion Repositories DevTools

Rev

Rev 227 | Rev 273 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 227 Rev 255
Line 13... Line 13...
13
#
13
#
14
# Usage:
14
# Usage:
15
#
15
#
16
#......................................................................#
16
#......................................................................#
17
 
17
 
18
require 5.6.1;
18
require 5.006_001;
19
use strict;
19
use strict;
20
use warnings;
20
use warnings;
21
use Cwd;
21
use Cwd;
22
use FileUtils;
22
use FileUtils;
23
use JatsSystem;
23
use JatsSystem;
Line 127... Line 127...
127
#   The required architecture
127
#   The required architecture
128
#
128
#
129
my $ARCH;
129
my $ARCH;
130
   $ARCH = 'arm'  if ( $opt_arch =~ m/arm/i );
130
   $ARCH = 'arm'  if ( $opt_arch =~ m/arm/i );
131
   $ARCH = 'i386' if ( $opt_arch =~ m/i386/i );
131
   $ARCH = 'i386' if ( $opt_arch =~ m/i386/i );
-
 
132
   $ARCH = 'powerpc' if ( $opt_arch =~ m/powerpc/i );
132
   Error ("Cannot determine architecture") unless ( $ARCH );
133
   Error ("Cannot determine architecture") unless ( $ARCH );
133
 
134
 
134
#
135
#
135
#   Source files
136
#   Source files
136
#   These may be comma seperated. Expand the array
137
#   These may be comma seperated. Expand the array
Line 182... Line 183...
182
#
183
#
183
#   Remove some 'make' environment variables
184
#   Remove some 'make' environment variables
184
#   The JATS make and the PACKAGE make must not know about each other
185
#   The JATS make and the PACKAGE make must not know about each other
185
#
186
#
186
foreach my $var qw ( MAKE MAKEFLAGS MAKEOVERRIDES MAKELEVEL MAKE_MODE
187
foreach my $var qw ( MAKE MAKEFLAGS MAKEOVERRIDES MAKELEVEL MAKE_MODE
187
                     CC CXX CPP CFLAGS ASFLAGS LDFLAGS
188
                     CC CXX CPP EXTRA_CFLAGS CFLAGS ASFLAGS LDFLAGS
188
                     DEBFLAGS LDDINC DEBUG KERNELRELEASE LDDINC
189
                     DEBFLAGS LDDINC DEBUG KERNELRELEASE LDDINC
189
                     )
190
                     )
190
{
191
{
191
    delete $ENV{$var};
192
    delete $ENV{$var};
192
}
193
}
Line 257... Line 258...
257
        if ( m~__DEFINES__~ )
258
        if ( m~__DEFINES__~ )
258
        {
259
        {
259
            print KBUILD "# User definitions\n";
260
            print KBUILD "# User definitions\n";
260
            foreach my $line ( @opt_defs )
261
            foreach my $line ( @opt_defs )
261
            {
262
            {
262
                print KBUILD "CFLAGS += -D$line\n";
263
                print KBUILD "EXTRA_CFLAGS += -D$line\n";
263
            }
264
            }
264
            print KBUILD "# End of User definitions\n";
265
            print KBUILD "# End of User definitions\n";
265
            next;
266
            next;
266
        }
267
        }
267
 
268
 
Line 276... Line 277...
276
                    next;
277
                    next;
277
                }
278
                }
278
 
279
 
279
                if ( $line =~ m~^/~ )
280
                if ( $line =~ m~^/~ )
280
                {
281
                {
281
                    print KBUILD "CFLAGS += -I$line\n";
282
                    print KBUILD "EXTRA_CFLAGS += -I$line\n";
282
                }
283
                }
283
                else
284
                else
284
                {
285
                {
285
                    print KBUILD "CFLAGS += -I\$(PWD)/$line\n";
286
                    print KBUILD "EXTRA_CFLAGS += -I\$(PWD)/$line\n";
286
                }
287
                }
287
            }
288
            }
288
            print KBUILD "# End of User Include Directories\n";
289
            print KBUILD "# End of User Include Directories\n";
289
            next;
290
            next;
290
        }
291
        }
Line 328... Line 329...
328
 
329
 
329
__DEFINES__
330
__DEFINES__
330
 
331
 
331
__INCDIR__
332
__INCDIR__
332
 
333
 
333
# Add your debugging flag (or not) to CFLAGS
334
# Add your debugging flag (or not) to EXTRA_CFLAGS
334
ifeq ($(DEBUG),y)
335
ifeq ($(DEBUG),y)
335
  DEBFLAGS = -O -g -DDEV_DEBUG # "-O" is needed to expand inlines
336
  DEBFLAGS = -O -g -DDEV_DEBUG # "-O" is needed to expand inlines
336
else
337
else
337
  DEBFLAGS = -O2
338
  DEBFLAGS = -O2
338
endif
339
endif
339
 
340
 
340
CFLAGS += $(DEBFLAGS)
341
EXTRA_CFLAGS += $(DEBFLAGS)
341
CFLAGS += -I$(LDDINC)
342
EXTRA_CFLAGS += -I$(LDDINC)
342
 
343
 
343
ifneq ($(KERNELRELEASE),)
344
ifneq ($(KERNELRELEASE),)
344
# call from kernel build system
345
# call from kernel build system
345
 
346
 
346
llcd-objs := __FILE_LIST__
347
llcd-objs := __FILE_LIST__
Line 355... Line 356...
355
	$(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/../include modules
356
	$(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/../include modules
356
 
357
 
357
endif
358
endif
358
 
359
 
359
depend .depend dep:
360
depend .depend dep:
360
	$(CC) $(CFLAGS) -M *.c > .depend
361
	$(CC) $(EXTRA_CFLAGS) -M *.c > .depend
361
 
362
 
362
 
363
 
363
ifeq (.depend,$(wildcard .depend))
364
ifeq (.depend,$(wildcard .depend))
364
include .depend
365
include .depend
365
endif
366
endif