See ChangeLog: 19990620-02:40
This commit is contained in:
@@ -1,3 +1,47 @@
|
||||
19990620-02:40 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
* config/bin.cf
|
||||
* config/lib.cfg
|
||||
* config/rules.cf
|
||||
* config/linux/gcc.cf
|
||||
* config/win32/gcc.cf
|
||||
* config/win32/msvc.cf
|
||||
* config/dos/dir.cf
|
||||
* config/dos/djgpp.cf
|
||||
* config/dos/global.cf
|
||||
* config/dos/install.cf
|
||||
+ config/dos/watcom.cf
|
||||
* added support for other compilers not compatible with gcc
|
||||
(there were gcc switches hardcoded into common rules)
|
||||
New compiler: Watcom C/C++ 10.0
|
||||
* changed rules for DJGPP - the Makefile can be used now to
|
||||
create harbour with DJGPP. The makedos.env and makefile.dos
|
||||
are obsolete now.
|
||||
* cleared the use of '\' and '/' in make rules for DOS environment
|
||||
* the make looks now for COMSPEC variable to locate the command.com
|
||||
in DOS environment
|
||||
* changed the rule for creating DJGPP library (archive) to use
|
||||
script file instead of command line - there is a limit of 128
|
||||
characters that can be placed into command line in DOS
|
||||
|
||||
+ include/hbpp.h
|
||||
+ new file with definition shared by the preprocessor and harbour.y
|
||||
(needed to match the declaration of AddDefine function)
|
||||
|
||||
* source/hbpp/harb.h
|
||||
* changed to include the new hbpp.h file
|
||||
|
||||
* source/compiler/harbour.y
|
||||
* changed the declaration of yy_create_buffer to make it compatible
|
||||
with C++ compilers
|
||||
* added inclusion of hbpp.h (to keep C++ compilers happy with
|
||||
AaddDefine function)
|
||||
|
||||
* source/compiler/harbour.l
|
||||
+ added #pragma to suppress warnings of unreachable code when
|
||||
compiled with Watcom C++ compiler
|
||||
|
||||
|
||||
19990619-14:35 CET Matteo Baccan
|
||||
* makefile.vc, source/hbpp/hbpp.c, source/hbpp/hbppint.c,
|
||||
source/rtl/environ.c, source/rtl/files.c, source/rtl/gt/gtwin.c,
|
||||
|
||||
@@ -6,7 +6,14 @@ include $(TOP)$(ROOT)config/global.cf
|
||||
include $(TOP)$(ROOT)config/c.cf
|
||||
|
||||
EXE_NAME = $(C_MAIN:.c=$(EXE_EXT))
|
||||
|
||||
_EXE_ARCH = $(notdir $(ARCH_DIR))
|
||||
ifeq ($(_EXE_ARCH),)
|
||||
# ARCH_DIR ends with a slash
|
||||
EXE_ARCH = $(ARCH_DIR)$(EXE_NAME)
|
||||
else
|
||||
EXE_ARCH = $(ARCH_DIR)/$(EXE_NAME)
|
||||
endif
|
||||
|
||||
ALL_OBJS = $(ALL_C_OBJS) $(ALL_PRG_OBJS)
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ DIR_RULE =\
|
||||
@echo Done
|
||||
else
|
||||
DIR_LIST = $(subst /,\,$(DIRS))
|
||||
DIR_MAKE = $(subst /,\,$(MK))
|
||||
DIR_RULE =\
|
||||
command.com /c FOR %d IN ($(DIR_LIST)) DO $(MK) -C %d $@
|
||||
$(COMSPEC) /C FOR %d IN ($(DIR_LIST)) DO $(DIR_MAKE) -C %d $@
|
||||
endif
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
|
||||
include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf
|
||||
|
||||
OBJ_EXT = .obj
|
||||
OBJ_EXT = .o
|
||||
EXE_EXT = .exe
|
||||
LIB_PREF =
|
||||
LIB_EXT = .lib
|
||||
LIB_PREF = lib
|
||||
LIB_EXT = .a
|
||||
|
||||
CC = gcc
|
||||
CC_IN = -c
|
||||
CC_OUT = -o
|
||||
CPPFLAGS = -DDEBUG -I. -I$(HB_INC_DIR)
|
||||
CFLAGS = -Wall -g
|
||||
@@ -22,8 +23,24 @@ endif
|
||||
LINKLIBS = $(foreach lib, $(LIBS), -l$(lib))
|
||||
# LINKLIBS += -lm
|
||||
|
||||
#Note: The empty line below HAVE TO exist!
|
||||
define lib_object
|
||||
echo ADDMOD $(file) >> __lib__.tmp
|
||||
|
||||
endef
|
||||
|
||||
define create_library
|
||||
echo CREATE $@ > __lib__.tmp
|
||||
$(foreach file, $^, $(lib_object))
|
||||
echo SAVE >> __lib__.tmp
|
||||
echo END >> __lib__.tmp
|
||||
$(AR) -M < __lib__.tmp
|
||||
del __lib__.tmp
|
||||
endef
|
||||
|
||||
AR = ar
|
||||
ARFLAGS =
|
||||
AR_RULE = $(AR) $(ARFLAGS) r $@ $^ || $(RM) $@
|
||||
#AR_RULE = $(AR) $(ARFLAGS) r $@ $^ || $(RM) $@
|
||||
AR_RULE = $(create_library)
|
||||
|
||||
include $(TOP)$(ROOT)config/rules.cf
|
||||
|
||||
@@ -2,10 +2,27 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
ARCH_DIR = $(subst /,\,$(ARCH)\)
|
||||
MK = $(subst /,\,$(subst \~,~,$(MAKE)))
|
||||
all : first
|
||||
|
||||
RM = del /q
|
||||
ARCH_DIR = $(subst \,/,$(ARCH))
|
||||
ARCH_DOS = $(subst /,\,$(ARCH))
|
||||
MK = $(subst \,/,$(subst \~,~,$(MAKE)))
|
||||
|
||||
ifeq ($(HB_INC_DIR),)
|
||||
HB_INC_DIR=$(TOP)$(ROOT)include
|
||||
endif
|
||||
ifeq ($(HB_LIB_DIR),)
|
||||
HB_LIB_DIR=$(TOP)$(ROOT)libs
|
||||
endif
|
||||
ifeq ($(HB_BIN_DIR),)
|
||||
HB_BIN_DIR=$(TOP)$(ROOT)bin
|
||||
endif
|
||||
|
||||
ifeq ($(COMSPEC),) #location of command.com
|
||||
COMSPEC = command.com
|
||||
endif
|
||||
|
||||
RM = del
|
||||
RD = rmdir
|
||||
CP = copy
|
||||
MV = move
|
||||
@@ -13,9 +30,9 @@ MD = md
|
||||
|
||||
dirbase::
|
||||
-$(MD) $(HB_ARCHITECTURE) >NUL
|
||||
-$(MD) $(ARCH_DIR) >NUL
|
||||
|
||||
-$(MD) $(ARCH_DOS) >NUL
|
||||
|
||||
clean::
|
||||
-$(RM) $(ARCH_DIR)\*.*
|
||||
-$(RD) $(ARCH_DIR)
|
||||
-echo Y | $(RM) $(ARCH_DOS)\*.*
|
||||
-$(RD) $(ARCH_DOS)
|
||||
-$(RD) $(HB_ARCHITECTURE)
|
||||
@@ -6,4 +6,4 @@ include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf
|
||||
|
||||
INSTALL_LIST = $(subst /,\,$(INSTALL_OBJS))
|
||||
INSTALL_RULE =\
|
||||
command.com /c FOR %f IN ($(INSTALL_LIST)) DO COPY %f $(INSTALL_DIR)
|
||||
$(COMSPEC) /c FOR %f IN ($(INSTALL_LIST)) DO COPY %f $(subst /,\,$(INSTALL_DIR))
|
||||
|
||||
60
harbour/config/dos/watcom.cf
Normal file
60
harbour/config/dos/watcom.cf
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf
|
||||
|
||||
OBJ_EXT = .obj
|
||||
EXE_EXT = .exe
|
||||
LIB_PREF =
|
||||
LIB_EXT = .lib
|
||||
|
||||
$(HB_ARCHITECTURE)_$(HB_COMPILER)_GRANDP = $(subst /,\\,$(GRANDP))
|
||||
_HB_INC_DIR = $(subst /,\\,$(HB_INC_DIR))
|
||||
_HB_LIB_DIR = $(subst /,\,$(HB_LIB_DIR))
|
||||
WATCOM_INCLUDE = $(subst \,\\,$(WATCOM))\\h
|
||||
|
||||
CC = wpp386
|
||||
CC_IN =
|
||||
CC_OUT = -fo=
|
||||
CPPFLAGS = -d2 -w2 -5r -zq -zt0 -bt=DOS4G
|
||||
CFLAGS = -i$(WATCOM_INCLUDE) -i$(_HB_INC_DIR) -i.
|
||||
|
||||
#Note: The empty line below HAVE TO exist!
|
||||
define link_file
|
||||
echo FILE $(file) >> __link__.tmp
|
||||
|
||||
endef
|
||||
|
||||
define link_exe_file
|
||||
echo $(LDFLAGS) > __link__.tmp
|
||||
echo NAME $@ >> __link__.tmp
|
||||
$(foreach file, $^, $(link_file))
|
||||
echo $(LINKLIBS) >> __link__.tmp
|
||||
$(LD) @__link__.tmp
|
||||
del __link__.tmp
|
||||
endef
|
||||
|
||||
LD = wlink
|
||||
LDFLAGS = debug all OP osn=DOS4G OP stack=16384
|
||||
LINKLIBS = LIBP $(_HB_LIB_DIR) LIB $(foreach lib, $(LIBS), $(lib))
|
||||
LD_RULE = $(link_exe_file)
|
||||
|
||||
#Note: The empty line below HAVE TO exist!
|
||||
define lib_object
|
||||
echo -+$(file) >> __lib__.tmp
|
||||
|
||||
endef
|
||||
|
||||
define create_library
|
||||
echo $@ > __lib__.tmp
|
||||
$(foreach file, $^, $(lib_object))
|
||||
$(AR) @__lib__.tmp
|
||||
del __lib__.tmp
|
||||
endef
|
||||
|
||||
AR = wlib
|
||||
ARFLAGS =
|
||||
AR_RULE = $(create_library)
|
||||
|
||||
include $(TOP)$(ROOT)config/rules.cf
|
||||
@@ -7,7 +7,15 @@ include $(TOP)$(ROOT)config/c.cf
|
||||
include $(TOP)$(ROOT)config/prg.cf
|
||||
|
||||
LIB_NAME = $(LIB_PREF)$(LIB)$(LIB_EXT)
|
||||
|
||||
_ARCH_DIR = $(notdir $(ARCH_DIR))
|
||||
ifeq ($(_ARCH_DIR),)
|
||||
# ARCH_DIR ends with a slash
|
||||
LIB_ARCH = $(ARCH_DIR)$(LIB_NAME)
|
||||
else
|
||||
# there is no slash at the end of ARCH_DIR
|
||||
LIB_ARCH = $(ARCH_DIR)/$(LIB_NAME)
|
||||
endif
|
||||
|
||||
ALL_OBJS = $(ALL_C_OBJS) $(ALL_PRG_OBJS)
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ LIB_PREF = lib
|
||||
LIB_EXT = .a
|
||||
|
||||
CC = gcc
|
||||
CC_IN = -c
|
||||
CC_OUT = -o
|
||||
CPPFLAGS = -DDEBUG -I. -I$(HB_INC_DIR)
|
||||
CFLAGS = -Wall -g
|
||||
@@ -21,7 +22,6 @@ LDFLAGS = -L$(HB_LIB_DIR)
|
||||
endif
|
||||
LINKLIBS = $(foreach lib, $(LIBS), -l$(lib))
|
||||
LINKLIBS += -L/usr/lib -lm
|
||||
# LINKLIBS += -lm
|
||||
|
||||
AR = ar
|
||||
ARFLAGS =
|
||||
|
||||
@@ -11,12 +11,20 @@ LEX = flex
|
||||
LEX_FLAGS = -i -8
|
||||
|
||||
# How to run Harbour.
|
||||
HB = harbour$(EXE_EXT)
|
||||
_HB = $(notdir $(HB_BIN_DIR))
|
||||
ifeq ($(_HB),)
|
||||
# there is a slash at the end
|
||||
HB = $(HB_BIN_DIR)harbour$(EXE_EXT)
|
||||
else
|
||||
HB = $(HB_BIN_DIR)/harbour$(EXE_EXT)
|
||||
endif
|
||||
HB_FLAGS = -n -q -I$(TOP) -I$(HB_INC_DIR)
|
||||
|
||||
# The rule to link an executable.
|
||||
ifeq ($(LD_RULE),)
|
||||
# Use default rule if architecture/compiler specific rule is not defined
|
||||
LD_RULE = $(LD) $(CFLAGS) $(LD_OUT)$@ $^ $(LDFLAGS) $(LINKLIBS)
|
||||
|
||||
endif
|
||||
|
||||
# Eliminate these rules.
|
||||
|
||||
@@ -24,14 +32,21 @@ LD_RULE = $(LD) $(CFLAGS) $(LD_OUT)$@ $^ $(LDFLAGS) $(LINKLIBS)
|
||||
|
||||
%.c : %.l
|
||||
|
||||
# Location of source C files
|
||||
# Some DOS compilers doesn't like '/' in filenames - however the MAKE system
|
||||
# requires '/' in filenames - this trick allows to solve this conflict
|
||||
SOURCE_DIR := $($(HB_ARCHITECTURE)_$(HB_COMPILER)_GRANDP)
|
||||
ifeq ($(SOURCE_DIR),)
|
||||
SOURCE_DIR = $(GRANDP)
|
||||
endif
|
||||
|
||||
# Rule to generate an object file from a C source file in the parent.
|
||||
%$(OBJ_EXT) : $(GRANDP)%.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $? $(CC_OUT)$(subst .c,$(OBJ_EXT),$(subst $(GRANDP),,$?))
|
||||
%$(OBJ_EXT) : $(SOURCE_DIR)%.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_IN) $? $(CC_OUT)$(subst .c,$(OBJ_EXT),$(subst $(SOURCE_DIR),,$?))
|
||||
|
||||
# Rule to generate an object file from a C source file.
|
||||
%$(OBJ_EXT) : %.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $? $(CC_OUT)$(?:.c=$(OBJ_EXT))
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_IN) $? $(CC_OUT)$(?:.c=$(OBJ_EXT))
|
||||
|
||||
# Rule to generate an executable file from an object file.
|
||||
%$(EXE_EXT) : %$(OBJ_EXT)
|
||||
|
||||
27
harbour/include/hbpp.h
Normal file
27
harbour/include/hbpp.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Definitions shared by harbour.y and preprocessor
|
||||
*/
|
||||
|
||||
#ifndef HBPP_H_
|
||||
#define HBPP_H_
|
||||
|
||||
/* ------------------------------------------ */
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
char *pars;
|
||||
int npars;
|
||||
char *value;
|
||||
} DEFINES;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int com_or_xcom;
|
||||
char *name;
|
||||
char *mpatt;
|
||||
char *value;
|
||||
} COMMANDS, TRANSLATES;
|
||||
|
||||
#endif /* HBPP_H_ */
|
||||
@@ -86,6 +86,13 @@ void yy_lex_count_lf( void )
|
||||
|
||||
%}
|
||||
|
||||
%{
|
||||
#ifdef __WATCOMC__
|
||||
/* disable warnings for unreachable code */
|
||||
#pragma warning 13 9
|
||||
#endif
|
||||
%}
|
||||
|
||||
SpaceTab [ \t]+
|
||||
InvalidNumber [0-9]+\.
|
||||
Number ([0-9]+)|([0-9]*\.[0-9]+)
|
||||
@@ -1319,6 +1326,13 @@ Separator {SpaceTab}|{Comment}
|
||||
}
|
||||
}
|
||||
|
||||
%{
|
||||
#ifdef __WATCOMC__
|
||||
/* enable warnings for unreachable code */
|
||||
#pragma warning 13 1
|
||||
#endif
|
||||
%}
|
||||
|
||||
%%
|
||||
|
||||
PDEFINE LastDef( PDEFINE pDef )
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "types.h" /* our defined types */
|
||||
#include "compiler.h"
|
||||
#include "hberrors.h"
|
||||
#include "hbpp.h"
|
||||
|
||||
|
||||
#undef OurFree
|
||||
@@ -128,16 +129,17 @@ extern "C" int yywrap( void );
|
||||
#else
|
||||
int yywrap( void ); /* manages the EOF of current processed file */
|
||||
#endif
|
||||
void AddDefine( char * szDefine, char * szValue ); /* add a new Lex define from the command line */
|
||||
DEFINES *AddDefine( char * szDefine, char * szValue ); /* add a new Lex define from the command line */
|
||||
/* Following line added for preprocessor */
|
||||
void Hbpp_init ( void );
|
||||
|
||||
void * yy_create_buffer( FILE *, int ); /* yacc functions to manage multiple files */
|
||||
#ifdef __cplusplus
|
||||
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||
YY_BUFFER_STATE yy_create_buffer( FILE *, int ); /* yacc functions to manage multiple files */
|
||||
void yy_switch_to_buffer( YY_BUFFER_STATE ); /* yacc functions to manage multiple files */
|
||||
void yy_delete_buffer( YY_BUFFER_STATE ); /* yacc functions to manage multiple files */
|
||||
#else
|
||||
void * yy_create_buffer( FILE *, int ); /* yacc functions to manage multiple files */
|
||||
void yy_switch_to_buffer( void * ); /* yacc functions to manage multiple files */
|
||||
void yy_delete_buffer( void * ); /* yacc functions to manage multiple files */
|
||||
#endif
|
||||
|
||||
@@ -43,21 +43,7 @@ void * _xgrab( ULONG ); /* allocates fixed memory */
|
||||
void * _xrealloc( void *, ULONG ); /* reallocates memory */
|
||||
void _xfree( void * ); /* frees fixed memory */
|
||||
|
||||
/* ------------------------------------------ */
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
char *pars;
|
||||
int npars;
|
||||
char *value;
|
||||
} DEFINES;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int com_or_xcom;
|
||||
char *name;
|
||||
char *mpatt;
|
||||
char *value;
|
||||
} COMMANDS, TRANSLATES;
|
||||
/* includes common definitions shared by preprocessor and harbour.y */
|
||||
#include "hbpp.h"
|
||||
|
||||
#endif /* HARB_H_ */
|
||||
|
||||
Reference in New Issue
Block a user