Newsgroup: it.comp.lang.c++
Titolo: [makefile LINUX->WIN32] con bcc32 (ver5.5)

Sto cercando di riadattare dei sorgenti (e relativo makefile) scritto per
Linux/Unix
in modo che possa generare una applicazione win32 tramite il compilatore
free
borland BCC32.EXE (versione 5.5)
Risolti vari intoppetti... il problema (che mi sta bloccando da un pň) ora č
questo:
[Premesso che le estensioni sono in .C perň contengono istruzioni/strutture
del C++,
evidentemente i compilatori linux hanno dei comportamenti che ora
ignoro...ma non č questo il prob.]
(innanzi tutto volevo chiedervi se č lecito sostituire nel makefile tutti i
.o con .obj per
fare in modo che il bcc poi linki correttamente)... (č cosě che sono
riuscito a risolvere
un intoppetto)... se č lecito ciň...allora il problema č
eseguo
    make mu
ad un certo punto make mi chiede di far compilare (cioč giustamente non lo
trova) il file mu.cpp
ma questo ha estensione .C
Come posso risolvere il problema?
Incollo il codice del makefile (originale e modificato) per chi avesse la
pazienza di leggerlo.
Grazie a tutti...
(PREMETTO CHE E' SOLO CAMBIATA L'ESTENSIONE DEI FILE .O E
LA SCELTA DEL COMPILATORE E DELLE SUE OPZIONI)
###############################################################
###############################################################
##################### ORIGINALE ########################
###############################################################
###############################################################
#   Makefile for Murphi Compiler
#   (using "y.tab.c", "y.tab.h" and "lex.yy.c"
#    from precompiled "mu.l" and "mu.y")
#
#   *** warning ***
#   if you have changed "mu.l" and "mu.y",
#   please use "Makefile.full"
#
#   please make sure that you have set the
#   appropriate path for c++ compiler.
#
#   options:
#   1) "make" or "make mu"
#      --> compile mu
#   2) "make install"
#      --> compile mu and copy to bin directory
#   3) "make clean"
#      --> remove all intermediate files
#
#   Author : C. Norris Ip
#            modifications by Uli Stern
#   Created : March 94
########################################
# choice of the compiler with REQUIRED options
# remark: The C++ compilers based on cfront (CC, DCC, OCC) can only generate
#         very simple inline code. To avoid an error message, one has to
dis-
#         able all inlining.
# remark: The xlC C++ compiler by default only accepts C++ files with the
#         suffix ".C". It has to be started with the option "-+" to avoid
#         error messages when compiling lex.yy.c and y.tab.c. In addition,
#         one should turn off inlining when using optimization
#CPLUSPLUS = CC +d
#CPLUSPLUS = DCC +d
#CPLUSPLUS = OCC +d
CPLUSPLUS = g++
#CPLUSPLUS = xlC -+ -Q!
# choice of the options
CFLAGS = -O4                               # options for g++
#CFLAGS = -O4 -pipe -static #
#CFLAGS = -static #
#CFLAGS = -w #                              # options for OCC
#CFLAGS = -w -O3 #                          # options for DCC
OBJS =  \
 cpp_code.o \
 cpp_code_as.o \
 lex.yy.o \
 y.tab.o \
   cpp_sym.o \
   cpp_sym_aux.o \
   cpp_sym_decl.o \
 decl.o \
 error.o \
 expr.o \
 lextable.o \
 mu.o \
 parse.o \
 rule.o \
 stmt.o \
 symtab.o \
 util.o
########################################
# Makefile grammar
mu: $(OBJS)
 $(CPLUSPLUS) -o mu $(CFLAGS) $(OBJS)
mu.o: mu.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) mu.C
cpp_code.o: cpp_code.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_code.C
cpp_code_as.o: cpp_code_as.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_code_as.C
cpp_sym.o: cpp_sym.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_sym.C
cpp_sym_aux.o: cpp_sym_aux.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_sym_aux.C
cpp_sym_decl.o: cpp_sym_decl.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_sym_decl.C
decl.o: decl.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) decl.C
error.o: error.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) error.C
expr.o: expr.C mu.h y.tab.h
 $(CPLUSPLUS) -c $(CFLAGS) expr.C
lextable.o: lextable.C mu.h lextable.h y.tab.h
 $(CPLUSPLUS) -c $(CFLAGS) lextable.C
lextable.h: y.tab.h
no_code: no_code.o $(OBJS)
 $(CPLUSPLUS) -o no_code $(CFLAGS) no_code.o \
 decl.o \
 error.o \
 expr.o \
 lextable.o \
 mu.o \
 parse.o \
 rule.o \
 stmt.o \
 symtab.o \
 util.o \
 lex.yy.o \
 y.tab.o
no_code.o: no_code.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) no_code.C
rule.o: rule.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) rule.C
stmt.o: stmt.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) stmt.C
symtab.o: symtab.C mu.h lextable.h y.tab.h
 $(CPLUSPLUS) -c $(CFLAGS) symtab.C
util.o: util.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) util.C
parse.o: parse.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) parse.C
lex.yy.o: lex.yy.c mu.h lextable.h
 $(CPLUSPLUS) -c $(CFLAGS) lex.yy.c
y.tab.o: y.tab.c mu.h
 $(CPLUSPLUS) -c -DYYDEBUG=0 $(CFLAGS) y.tab.c
mu.h: decl.h expr.h stmt.h rule.h lextable.h y.tab.h cpp_sym.h
 touch -c mu.h
clean:
 rm -f  *.o no_code
remove:
 rm -f ../bin/mu.$(HOSTTYPE)
install: remove mu
 mv mu ../bin/mu.$(HOSTTYPE)
###############################################################
###############################################################
##################### MODIFICATO ########################
###############################################################
###############################################################
#   Makefile for Murphi Compiler
#   (using "y.tab.c", "y.tab.h" and "lex.yy.c"
#    from precompiled "mu.l" and "mu.y")
#
#   *** warning ***
#   if you have changed "mu.l" and "mu.y",
#   please use "Makefile.full"
#
#   please make sure that you have set the
#   appropriate path for c++ compiler.
#
#   options:
#   1) "make" or "make mu"
#      --> compile mu
#   2) "make install"
#      --> compile mu and copy to bin directory
#   3) "make clean"
#      --> remove all intermediate files
#
#   Author : C. Norris Ip
#            modifications by Uli Stern
#   Created : March 94
########################################
# choice of the compiler with REQUIRED options
# remark: The C++ compilers based on cfront (CC, DCC, OCC) can only generate
#         very simple inline code. To avoid an error message, one has to
dis-
#         able all inlining.
# remark: The xlC C++ compiler by default only accepts C++ files with the
#         suffix ".C". It has to be started with the option "-+" to avoid
#         error messages when compiling lex.yy.c and y.tab.c. In addition,
#         one should turn off inlining when using optimization
#CPLUSPLUS = CC +d
#CPLUSPLUS = DCC +d
#CPLUSPLUS = OCC +d
#CPLUSPLUS = g++
#CPLUSPLUS = xlC -+ -Q!
CPLUSPLUS = bcc32
# choice of the options
#CFLAGS = -O4                               # options for g++
#CFLAGS = -O4 -pipe -static #
#CFLAGS = -static #
#CFLAGS = -w #                              # options for OCC
#CFLAGS = -w -O3 #                          # options for DCC
CFLAGS
= -IC:\Programmi\Borland\BCC55\Include;C:\Documenti\TESI2\Murphy\Murphi3.1\i
nclude -P
#estensione per output -nC:\Documenti\TESI2\Murphy\Murphi3.1\bin
OBJS =  \
 cpp_code.obj \
 cpp_code_as.obj \
 lex.yy.obj \
 y.tab.obj \
   cpp_sym.obj \
   cpp_sym_aux.obj \
   cpp_sym_decl.obj \
 decl.obj \
 error.obj \
 expr.obj \
 lextable.obj \
 mu.obj \
 parse.obj \
 rule.obj \
 stmt.obj \
 symtab.obj \
 util.obj
########################################
# Makefile grammar
mu: $(OBJS)
 $(CPLUSPLUS) -o mu $(CFLAGS) $(OBJS)
mu.obj: mu.C mu.h
 $(CPLUSPLUS) -c  $(CFLAGS) mu.C
cpp_code.obj: cpp_code.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_code.C
cpp_code_as.obj: cpp_code_as.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_code_as.C
cpp_sym.obj: cpp_sym.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_sym.C
cpp_sym_aux.obj: cpp_sym_aux.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_sym_aux.C
cpp_sym_decl.obj: cpp_sym_decl.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) cpp_sym_decl.C
decl.obj: decl.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) decl.C
error.obj: error.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) error.C
expr.obj: expr.C mu.h y.tab.h
 $(CPLUSPLUS) -c $(CFLAGS) expr.C
lextable.obj: lextable.C mu.h lextable.h y.tab.h
 $(CPLUSPLUS) -c $(CFLAGS) lextable.C
lextable.h: y.tab.h
no_code: no_code.obj $(OBJS)
 $(CPLUSPLUS) -o no_code $(CFLAGS) no_code.obj \
 decl.obj \
 error.obj \
 expr.obj \
 lextable.obj \
 mu.obj \
 parse.obj \
 rule.obj \
 stmt.obj \
 symtab.obj \
 util.obj \
 lex.yy.obj \
 y.tab.obj
no_code.obj: no_code.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) no_code.C
rule.obj: rule.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) rule.C
stmt.obj: stmt.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) stmt.C
symtab.obj: symtab.C mu.h lextable.h y.tab.h
 $(CPLUSPLUS) -c $(CFLAGS) symtab.C
util.obj: util.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) util.C
parse.obj: parse.C mu.h
 $(CPLUSPLUS) -c $(CFLAGS) parse.C
lex.yy.obj: lex.yy.c mu.h lextable.h
 $(CPLUSPLUS) -c $(CFLAGS) lex.yy.c
y.tab.obj: y.tab.c mu.h
 $(CPLUSPLUS) -c -DYYDEBUG=0 $(CFLAGS) y.tab.c
mu.h: decl.h expr.h stmt.h rule.h lextable.h y.tab.h cpp_sym.h
 touch -c mu.h
clean:
 rm -f  *.obj no_code
remove:
 rm -f ../bin/mu.$(HOSTTYPE)
install: remove mu
 mv mu ../bin/mu.$(HOSTTYPE)

                                     ^^^^^^
