home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lxapi32.zip
/
SKELETON
/
Tools
/
Config.cmd
< prev
Wrap
OS/2 REXX Batch file
|
2002-04-26
|
4KB
|
116 lines
/* $Id: Config.cmd,v 1.2 2002/04/26 23:09:43 smilcke Exp $ */
/*
* Configuration script.
* Generates global makefile.inc.
*
* Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
* Modified for SKELETON-Drivers 2002 Stefan Milcke
*
*/
Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs';
Call SysLoadFuncs;
Parse Arg sIncFile
if (sIncFile='') Then sIncFile='paths.mak'
Say 'Current directory:'directory()
Say 'Generating 'directory()'\'sIncFile
/* Status */
Say 'Configuring the SKEL32 driver...'
/* delete old file */
Call SysFileDelete sIncFile
/* open target file */
If (Stream(sIncFile, 'C', 'OPEN WRITE' ) <> '') Then
Do
Call LineOut sIncFile, '################################################################################'
Call LineOut sIncFile, '# Generated by 'directory()'\config.cmd'
Call LineOut sIncFile, '################################################################################'
Call LineOut sIncFile, ''
Call LineOut sIncFile, '################################################################################'
Call LineOut sIncFile, '# Base directories'
Call LineOut sIncFile, '# Note! These should be absolute paths!'
Call LineOut sIncFile, '################################################################################'
Call LineOut sIncFile, ''
Call LineOut sIncFile, '!ifndef DEVTYPE'
Call LineOut sIncFile, '!error DEVTYPE not defined!'
Call LineOut sIncFile, '!endif'
sBase=directory();
Call LineOut sIncFile, ''
Call LineOut sIncFile, 'DRV_BASE ='sBase
Call LineOut sIncFile, 'LX_BASE =$(%LXAPI32DEV)'
Call LineOut sIncFile, ''
Call LineOut sIncFile, 'LX_MAINMAKE =$(LX_BASE)\makes\mainmake.mak'
Call LineOut sIncFile, ''
Call LineOut sIncFile, 'LX_LIB =$(LX_BASE)\lib'
Call LineOut sIncFile, ''
Call WriteSubDir 'DRV_BIN' ,'bin'
Call WriteSubDir 'DRV_INC' ,'inc'
Call LineOut sIncFile, 'DRV_INCLUDE =..\include;$(LX_BASE)\include'
Call WriteSubDir 'DRV_LIB' ,'lib'
Call WriteSubDir 'DRV_MAKES' ,'makes'
Call WriteSubDir 'DRV_TOOLS' ,'tools'
Call WriteSubDir 'DRV_BTTV' ,'bttv'
Call WriteSubDir 'DRV_LIB32' ,'lib32'
Call WriteSubDir 'DRV_DEV32' ,'dev32'
Call WriteSubDir 'DRV_LINUX' ,'linux'
Call LineOut sIncFile, 'DRV_OBJ =bin'
Call LineOut sIncFile, ''
Call LineOut sIncFile, '!ifeq DEVTYPE DEV32'
Call WriteSubDir 'DRV_SRC' ,'dev32'
Call LineOut sIncFile, '!endif'
Call LineOut sIncFile, ''
Call LineOut sIncFile, '!ifeq DEVTYPE LIB32'
Call WriteSubDir 'DRV_SRC' ,'lib32'
Call LineOut sIncFile, '!endif'
Call LineOut sIncFile, ''
Call LineOut sIncFile, '!ifeq DEVTYPE SKEL'
Call WriteSubDir 'DRV_SRC' ,'skel'
Call LineOut sIncFile, '!endif'
Call LineOut sIncFile, ''
Call LineOut sIncFile, 'CM_TOOLS =$(LX_BASE)\tools'
Call Stream sIncFile, 'C', 'CLOSE';
Call directory(sOldDir);
Say 'Configuration completed!'
Say ''
Say 'To build the SKEL32 driver release version do:'
Say ' WMAKE /ms'
Say 'To build the SKEL32 driver debug version do:'
Say ' WMAKE /ms DEBUG=1'
End
Else
Do
Say 'oops, failed to open outputfile,' sIncFile;
Exit 1;
End
Exit 0;
/*****************/
/* function area */
/*****************/
WriteSubDir: Procedure Expose sIncFile
M=Arg(1)
SubDir=Arg(2)
If SubDir='' Then
Do
SubDir=Right(M,Length(M)-5)
End
If Length(M) < 16 Then
Do
M=Left(M' ',16)
End
SubDir=Translate(SubDir,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
Call LineOut sIncFile, M'=$(DRV_BASE)\'SubDir
Return