From: kvigor Date: Sun, 5 Mar 2000 23:47:14 +0000 (+0000) Subject: Clean up Borland C++ makefiles and add (lousy) documentation X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=2a49765047102a2d9655bf84a1482aa23345de17;p=fw%2Fsdcc Clean up Borland C++ makefiles and add (lousy) documentation git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@166 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/Bcc.inc b/Bcc.inc new file mode 100644 index 00000000..68c872d8 --- /dev/null +++ b/Bcc.inc @@ -0,0 +1,6 @@ +#Generic rules and options for building with Borland C++ + +OFLAGS = -6 -O2 -g0 -w-proto + +.c.obj: + BCC32 -c $(OFLAGS) $(CFLAGS) $(CPPFLAGS) $< diff --git a/as/mcs51/Makefile.bcc b/as/mcs51/Makefile.bcc index f62392a1..e289a428 100644 --- a/as/mcs51/Makefile.bcc +++ b/as/mcs51/Makefile.bcc @@ -10,14 +10,12 @@ VERSIONP = 0 PRJDIR = ../.. -CPPFLAGS = -I. -I$(PRJDIR) -CFLAGS = -6 -O -g0 +!include ..\..\Bcc.inc + +CFLAGS = -I. -I$(PRJDIR) M_OR_MM = -MM LDFLAGS = -.c.obj: - BCC32 -c $(CFLAGS) $(CPPFLAGS) $< - ASOBJECTS = asmain.obj aslex.obj assym.obj assubr.obj asnoice.obj \ asexpr.obj asdata.obj aslist.obj asout.obj asstore.obj \ i51ext.obj i51pst.obj i51mch.obj i51adr.obj diff --git a/bin/packihx b/bin/packihx index f4a12954..4956fe51 100755 --- a/bin/packihx +++ b/bin/packihx @@ -59,7 +59,7 @@ while (<>) &flush_pending_data; $pendingDataStart = 0; $nextOffset = 0; - print; + print; } else { diff --git a/doc/bccinst.txt b/doc/bccinst.txt new file mode 100644 index 00000000..76e722b1 --- /dev/null +++ b/doc/bccinst.txt @@ -0,0 +1,20 @@ +Building SDCC with Borland C++ under Windows + +1: Build SDCC under Cygwin as documented in cygwininst.txt (this is +necessary in order to run all the necessary configuration steps). + +2: If necessary, modify support\gc\BCC_Makefile to point to your Borland +C++ installation. + +3: From the sdcc directory, run the command "make -f Makefile.bcc". This +should regenerate all the .exe files in the bin directory except for +sdcdb.exe (which currently doesn't build under Borland C++). + +4: If you modify any source files and need to rebuild, be aware that the +dependancies may not be correctly calculated. The safest option is to +delete all .obj files and run the build again. From a Cygwin BASH +prompt, this can easily be done with the commmand: + + 'find . -name "*.obj" -print | xargs rm' + +from the sdcc directory. diff --git a/src/Makefile.bcc b/src/Makefile.bcc index d788d391..ce5d24a3 100644 --- a/src/Makefile.bcc +++ b/src/Makefile.bcc @@ -42,10 +42,8 @@ ports: $(TARGET): $(OBJECTS) $(PORT_LIBS) bcc32 -e$(TARGET) $(OBJECTS) $(PORT_LIBS) $(LIBGC) -CFLAGS = -6 -O -g0 -I. -I.. -I..\support - -.c.obj: - BCC32 -c $(CFLAGS) $(CPPFLAGS) $< +!include ..\Bcc.inc +CFLAGS = -I. -I.. -I..\support SDCCy.h: SDCCy.c diff --git a/src/mcs51/Makefile.bcc b/src/mcs51/Makefile.bcc index bc0ae897..4b17a92d 100644 --- a/src/mcs51/Makefile.bcc +++ b/src/mcs51/Makefile.bcc @@ -5,10 +5,8 @@ PRJDIR = ../.. OBJ = gen.obj ralloc.obj main.obj LIB = port.lib -CFLAGS = -6 -O -g0 -I.. -I. -I..\.. -I..\..\support - -.c.obj: - BCC32 -c $(CFLAGS) $(CPPFLAGS) $< +!include ..\..\Bcc.inc +CFLAGS = -I.. -I. -I..\.. -I..\..\support all: $(LIB) diff --git a/src/z80/Makefile.bcc b/src/z80/Makefile.bcc index 1b2c4688..d6b240b7 100644 --- a/src/z80/Makefile.bcc +++ b/src/z80/Makefile.bcc @@ -5,10 +5,8 @@ PRJDIR = ../.. OBJ = gen.obj ralloc.obj main.obj gbz80.obj LIB = port.lib -CFLAGS = -6 -O -g0 -I.. -I. -I..\.. -I..\..\support - -.c.obj: - BCC32 -c $(CFLAGS) $(CPPFLAGS) $< +!include ..\..\Bcc.inc +CFLAGS = -I.. -I. -I..\.. -I..\..\support all: $(LIB) diff --git a/support/cpp/Makefile.bcc b/support/cpp/Makefile.bcc index 8b6ab2b9..66758159 100644 --- a/support/cpp/Makefile.bcc +++ b/support/cpp/Makefile.bcc @@ -23,9 +23,8 @@ man2dir = $(mandir)/man2 infodir = ${prefix}/info STD_INC = @sdcc_include_dir@ -#CPPFLAGS = -I. -I$(PRJDIR) -D_FORASXXXX_ -#CFLAGS = -ggdb -O2 -pipe -CFLAGS = -6 -O -g0 -I. -I$(PRJDIR) -D_FORASXXXX_ +!include ..\..\bcc.inc +CFLAGS = -I. -I$(PRJDIR) -D_FORASXXXX_ M_OR_MM = -MM LDFLAGS = @@ -43,10 +42,5 @@ $(TARGET): $(OBJECTS) !include Makefile.dep -# My rules -# -------- -.c.obj: - BCC32 -c $(CFLAGS) $(CPPFLAGS) $< - # End of cpp/Makefile