diff --git a/setup/BLDUTIL3.i b/setup/BLDUTIL3.c similarity index 99% rename from setup/BLDUTIL3.i rename to setup/BLDUTIL3.c index 29d5608..82e2b4e 100644 --- a/setup/BLDUTIL3.i +++ b/setup/BLDUTIL3.c @@ -17,6 +17,8 @@ BuiLD system UTILities part 3 */ +#include "COREDEFS.h" + #define src_d_name "src" #define cfg_d_name "cfg" diff --git a/setup/BLDUTIL4.i b/setup/BLDUTIL4.c similarity index 99% rename from setup/BLDUTIL4.i rename to setup/BLDUTIL4.c index 3bf0aa9..f4cd143 100644 --- a/setup/BLDUTIL4.i +++ b/setup/BLDUTIL4.c @@ -17,6 +17,9 @@ BuiLD system UTILities part 4 */ +#include "COREDEFS.h" +#include "CNFGDLFT.h" + LOCALPROC WriteOutDummyContents(void) { WriteDestFileLn( diff --git a/setup/CONFIGUR.i b/setup/CONFIGUR.i deleted file mode 100644 index 34b0dec..0000000 --- a/setup/CONFIGUR.i +++ /dev/null @@ -1,10 +0,0 @@ -/* - CONFIGUR.i -*/ - -/* - CONFIGURation file - - see CNFGDLFT.i and CNFGOPTS.i for things - that can go here. -*/ diff --git a/setup/COREDEFS.i b/setup/COREDEFS.h similarity index 96% rename from setup/COREDEFS.i rename to setup/COREDEFS.h index d3b5a24..4a41619 100644 --- a/setup/COREDEFS.i +++ b/setup/COREDEFS.h @@ -1,5 +1,5 @@ /* - COREDEFS.i + COREDEFS.h Copyright (C) 2018 Paul C. Pratt You can redistribute this file and/or modify it under the terms @@ -17,6 +17,8 @@ CORE DEFinitionS */ +#ifndef _COREDEFS_H +#define _COREDEFS_H typedef unsigned long ui5b; typedef unsigned short ui4b; @@ -88,3 +90,5 @@ typedef MyByte *MyPtr; #define EXPORTVAR static GLOBALVAR MyPtr pDt; + +#endif diff --git a/setup/DFFILDEF.i b/setup/DFFILDEF.h similarity index 100% rename from setup/DFFILDEF.i rename to setup/DFFILDEF.h diff --git a/setup/GNBLDOPT.i b/setup/GNBLDOPT.c similarity index 99% rename from setup/GNBLDOPT.i rename to setup/GNBLDOPT.c index fa35150..f8dc66f 100644 --- a/setup/GNBLDOPT.i +++ b/setup/GNBLDOPT.c @@ -17,6 +17,8 @@ GeNeric BuiLD OPTions */ +#include "COREDEFS.h" + /* --- default definitions for SPBASDEF --- */ #ifndef MayUseSound diff --git a/setup/SPBASDEF.i b/setup/SPBASDEF.h similarity index 100% rename from setup/SPBASDEF.i rename to setup/SPBASDEF.h diff --git a/setup/SPBLDOPT.i b/setup/SPBLDOPT.c similarity index 99% rename from setup/SPBLDOPT.i rename to setup/SPBLDOPT.c index ec252b4..8d9abef 100644 --- a/setup/SPBLDOPT.i +++ b/setup/SPBLDOPT.c @@ -17,6 +17,8 @@ program SPecific BuiLD OPTions */ +#include "COREDEFS.h" + /* option: model */ enum { diff --git a/setup/SPCNFGAP.i b/setup/SPCNFGAP.c similarity index 99% rename from setup/SPCNFGAP.i rename to setup/SPCNFGAP.c index bbad0e9..fb60b89 100644 --- a/setup/SPCNFGAP.i +++ b/setup/SPCNFGAP.c @@ -20,6 +20,8 @@ only by platform specific code) */ +#include "COREDEFS.h" + LOCALPROC WriteAppSpecificCNFGRAPIoptions(void) { diff --git a/setup/SPCNFGGL.i b/setup/SPCNFGGL.c similarity index 99% rename from setup/SPCNFGGL.i rename to setup/SPCNFGGL.c index 6376639..0e6e1a2 100644 --- a/setup/SPCNFGGL.i +++ b/setup/SPCNFGGL.c @@ -17,6 +17,8 @@ program SPecific CoNFiGuration GLobals */ +#include "COREDEFS.h" + LOCALPROC WriteAppSpecificCNFGGLOBoptions(void) { WriteBlankLineToDestFile(); diff --git a/setup/SPFILDEF.i b/setup/SPFILDEF.c similarity index 99% rename from setup/SPFILDEF.i rename to setup/SPFILDEF.c index 91072ac..8fbb74a 100644 --- a/setup/SPFILDEF.i +++ b/setup/SPFILDEF.c @@ -17,7 +17,7 @@ program SPecific FILe DEFinitions */ - +#include "COREDEFS.h" /* --- list of source files --- */ diff --git a/setup/SPOTHRCF.i b/setup/SPOTHRCF.c similarity index 99% rename from setup/SPOTHRCF.i rename to setup/SPOTHRCF.c index 34fb54d..09af01e 100644 --- a/setup/SPOTHRCF.i +++ b/setup/SPOTHRCF.c @@ -17,6 +17,8 @@ program SPecific write OTHer ConFiguration files */ +#include "COREDEFS.h" + LOCALPROC WriteAppCNFGGLOBContents(void) { WriteCommonCNFGGLOBContents(); diff --git a/setup/USFILDEF.i b/setup/USFILDEF.c similarity index 99% rename from setup/USFILDEF.i rename to setup/USFILDEF.c index 8d7e7d3..4cdbb7a 100644 --- a/setup/USFILDEF.i +++ b/setup/USFILDEF.c @@ -17,6 +17,8 @@ USe program SPecific FILe DEFinitions */ +#include "COREDEFS.h" + LOCALPROC NullProc(void) { } diff --git a/setup/WRCNFGAP.i b/setup/WRCNFGAP.c similarity index 99% rename from setup/WRCNFGAP.i rename to setup/WRCNFGAP.c index 087733b..cd890c0 100644 --- a/setup/WRCNFGAP.i +++ b/setup/WRCNFGAP.c @@ -17,6 +17,8 @@ WRite "CNFGrAPi.h" */ +#include "COREDEFS.h" + LOCALPROC WriteOSXLocalTalkCNFGRAPI(void) { WriteDestFileLn("#include "); diff --git a/setup/WRCNFGGL.i b/setup/WRCNFGGL.c similarity index 99% rename from setup/WRCNFGGL.i rename to setup/WRCNFGGL.c index e49334f..dfaad79 100644 --- a/setup/WRCNFGGL.i +++ b/setup/WRCNFGGL.c @@ -17,6 +17,8 @@ WRite "CNFGGLob.h" */ +#include "COREDEFS.h" + LOCALPROC WriteConfigurationWarning(void) { diff --git a/setup/WRMACRES.i b/setup/WRMACRES.c similarity index 99% rename from setup/WRMACRES.i rename to setup/WRMACRES.c index 1848a97..ba8deed 100644 --- a/setup/WRMACRES.i +++ b/setup/WRMACRES.c @@ -17,6 +17,8 @@ WRite MACintosh RESources configuration */ +#include "COREDEFS.h" + LOCALPROC WriteBeginResResource(char *types, int id) { diff --git a/setup/WRMPLIST.i b/setup/WRMPLIST.c similarity index 99% rename from setup/WRMPLIST.i rename to setup/WRMPLIST.c index fcfb89b..02707da 100644 --- a/setup/WRMPLIST.i +++ b/setup/WRMPLIST.c @@ -17,6 +17,7 @@ WRite Macintosh PLIST */ +#include "COREDEFS.h" enum { kPListRaw, /* native plist data */ diff --git a/setup/WRTEXTFL.i b/setup/WRTEXTFL.c similarity index 99% rename from setup/WRTEXTFL.i rename to setup/WRTEXTFL.c index f679765..347a33c 100644 --- a/setup/WRTEXTFL.i +++ b/setup/WRTEXTFL.c @@ -17,6 +17,7 @@ WRite TEXT FiLe */ +#include "COREDEFS.h" /* --- routines for writing text files --- */ diff --git a/setup/config.h b/setup/config.h new file mode 100644 index 0000000..61cd872 --- /dev/null +++ b/setup/config.h @@ -0,0 +1,8 @@ +/* + Configuration file + + Insert overrides for defaults.h and options.h here +*/ + +#include "config/defaults.h" +#include "config/options.h" diff --git a/setup/CNFGDLFT.i b/setup/config/defaults.h similarity index 77% rename from setup/CNFGDLFT.i rename to setup/config/defaults.h index df36eb9..5ca082a 100644 --- a/setup/CNFGDLFT.i +++ b/setup/config/defaults.h @@ -1,5 +1,5 @@ /* - CNFGDLFT.i + defaults.h Copyright (C) 2018 Paul C. Pratt You can redistribute this file and/or modify it under the terms @@ -16,7 +16,7 @@ /* CoNFiGuration DeFauLTs - set default values for things not set in CONFIGUR.i + set default values for things not set in config.h */ @@ -32,6 +32,8 @@ #ifndef cur_ide +/* Automatic IDE selection */ +/* TODO: Fill out and/or remove other compilers */ #ifdef applec #define cur_ide gbk_ide_mpw #else @@ -40,7 +42,8 @@ #endif /* cur_ide */ - +/* Determine the IDE version, if applicable */ +/* TODO: Fill out and/or remove other compilers */ #ifndef ide_vers #if gbk_ide_xcd == cur_ide @@ -53,12 +56,14 @@ #endif /* ide_vers */ - +/* Use command line for ??? */ #ifndef UseCmndLine #define UseCmndLine 0 #endif +/* Check if we're on classic Mac OS, which can only store executables in */ +/* 32-kilobyte segments */ #ifndef NeedSegmenting #if gbk_ide_mpw == cur_ide @@ -70,6 +75,7 @@ #endif /* NeedSegmenting */ +/* Automatically determine makefile output format */ #ifndef gbo_script #if gbk_ide_mpw == cur_ide diff --git a/setup/CNFGOPTS.i b/setup/config/options.h similarity index 95% rename from setup/CNFGOPTS.i rename to setup/config/options.h index 1cba01c..2395195 100644 --- a/setup/CNFGOPTS.i +++ b/setup/config/options.h @@ -1,5 +1,5 @@ /* - CNFGOPTS.i + options.h Copyright (C) 2018 Paul C. Pratt You can redistribute this file and/or modify it under the terms @@ -14,14 +14,13 @@ */ /* - CoNFiGuration OPTionS + Configuration Options - choices that can be used in CONFIGUR.i + choices that can be used in config.h */ /* choices for cur_ide */ - #define gbk_ide_mpw 1 /* Macintosh Programmers Workshop */ #define gbk_ide_mw8 2 /* Metrowerks CodeWarrior */ #define gbk_ide_bgc 3 /* Gnu tools */ @@ -40,7 +39,6 @@ #define gbk_ide_mvc 15 /* Mini vMac C (a specific version of gcc) */ /* choices for gbo_script */ - #define gbk_script_mpw 1 #define gbk_script_applescript 2 #define gbk_script_bash 3 diff --git a/setup/WRDVCFLS.i b/setup/makefiles/bloodshed.c similarity index 100% rename from setup/WRDVCFLS.i rename to setup/makefiles/bloodshed.c diff --git a/setup/WRDMCFLS.i b/setup/makefiles/digitalmars.c similarity index 100% rename from setup/WRDMCFLS.i rename to setup/makefiles/digitalmars.c diff --git a/setup/WRBGCFLS.i b/setup/makefiles/gcc.c similarity index 99% rename from setup/WRBGCFLS.i rename to setup/makefiles/gcc.c index 507ba52..c0b38c3 100644 --- a/setup/WRBGCFLS.i +++ b/setup/makefiles/gcc.c @@ -17,6 +17,8 @@ WRite Bash Gnu C specific FiLeS */ +#include "../COREDEFS.h" +#include "../config.h" #define WriteXCDcallgcc WriteCompileCExec #if 0 diff --git a/setup/makefiles/gcc.h b/setup/makefiles/gcc.h new file mode 100644 index 0000000..6869a04 --- /dev/null +++ b/setup/makefiles/gcc.h @@ -0,0 +1,9 @@ +#ifndef _GCC_H +#include _GCC_H + +#include "../COREDEFS.h" + +LOCALPROC WriteBashGccSpecificFiles(void); +#define WriteSpecificFiles WriteBashGccSpecificFiles + +#endif \ No newline at end of file diff --git a/setup/WRCCCFLS.i b/setup/makefiles/generic.c similarity index 100% rename from setup/WRCCCFLS.i rename to setup/makefiles/generic.c diff --git a/setup/WRLCCFLS.i b/setup/makefiles/lcc.c similarity index 100% rename from setup/WRLCCFLS.i rename to setup/makefiles/lcc.c diff --git a/setup/makefiles/makefiles.h b/setup/makefiles/makefiles.h new file mode 100644 index 0000000..aeaf99d --- /dev/null +++ b/setup/makefiles/makefiles.h @@ -0,0 +1,61 @@ +#ifndef _MAKEFILES_H +#define _MAKEFILES_H + +#include "../config.h" + +/* Include the corresponsing platform-specific file */ + +#if gbk_ide_mpw == cur_ide +#include "mpw.h" +#endif + +#if gbk_ide_mw8 == cur_ide +#include "metrowerks8.h" +#endif + +#if gbk_ide_mvc == cur_ide +#include "minivmac.h" +#endif + +#if (gbk_ide_bgc == cur_ide) \ + || (gbk_ide_cyg == cur_ide) \ + || (gbk_ide_mgw == cur_ide) \ + || (gbk_ide_dkp == cur_ide) \ + || (gbk_ide_dvc == cur_ide) \ + || (gbk_ide_xcd == cur_ide) +#include "gcc.h" +#endif + +#if gbk_ide_snc == cur_ide +#include "sun.h" +#endif + +#if gbk_ide_msv == cur_ide +#include "msvc.h" +#endif + +#if gbk_ide_lcc == cur_ide +#include "lcc.h" +#endif + +#if gbk_ide_dvc == cur_ide +#include "bloodshed.h" +#endif + +#if gbk_ide_xcd == cur_ide +#include "xcode.h" +#endif + +#if gbk_ide_dmc == cur_ide +#include "digitalmars.h" +#endif + +#if gbk_ide_plc == cur_ide +#include "pelles.h" +#endif + +#if gbk_ide_ccc == cur_ide +#include "generic.h" +#endif + +#endif diff --git a/setup/WRMW8FLS.i b/setup/makefiles/metrowerks8.c similarity index 100% rename from setup/WRMW8FLS.i rename to setup/makefiles/metrowerks8.c diff --git a/setup/WRMVCFLS.i b/setup/makefiles/minivmac.c similarity index 100% rename from setup/WRMVCFLS.i rename to setup/makefiles/minivmac.c diff --git a/setup/WRMPWFLS.i b/setup/makefiles/mpw.c similarity index 100% rename from setup/WRMPWFLS.i rename to setup/makefiles/mpw.c diff --git a/setup/WRMSCFLS.i b/setup/makefiles/msvc.c similarity index 100% rename from setup/WRMSCFLS.i rename to setup/makefiles/msvc.c diff --git a/setup/WRPLCFLS.i b/setup/makefiles/pelles.c similarity index 100% rename from setup/WRPLCFLS.i rename to setup/makefiles/pelles.c diff --git a/setup/WRSNCFLS.i b/setup/makefiles/sun.c similarity index 100% rename from setup/WRSNCFLS.i rename to setup/makefiles/sun.c diff --git a/setup/WRXCDFLS.i b/setup/makefiles/xcode.c similarity index 100% rename from setup/WRXCDFLS.i rename to setup/makefiles/xcode.c diff --git a/setup/tool.c b/setup/tool.c index 7ea297d..8657148 100644 --- a/setup/tool.c +++ b/setup/tool.c @@ -17,11 +17,8 @@ #include #include -#include "COREDEFS.i" - -#include "CNFGOPTS.i" -#include "CONFIGUR.i" -#include "CNFGDLFT.i" +#include "COREDEFS.h" +#include "config.h" #define MyMoveBytes(src, dst, n) \ @@ -78,58 +75,7 @@ #pragma segment Body3 #endif -#if gbk_ide_mpw == cur_ide -#include "WRMPWFLS.i" -#endif - -#if gbk_ide_mw8 == cur_ide -#include "WRMW8FLS.i" -#endif - -#if gbk_ide_mvc == cur_ide -#include "WRMVCFLS.i" -#endif - -#if (gbk_ide_bgc == cur_ide) \ - || (gbk_ide_cyg == cur_ide) \ - || (gbk_ide_mgw == cur_ide) \ - || (gbk_ide_dkp == cur_ide) \ - || (gbk_ide_dvc == cur_ide) \ - || (gbk_ide_xcd == cur_ide) -#include "WRBGCFLS.i" -#endif - -#if gbk_ide_snc == cur_ide -#include "WRSNCFLS.i" -#endif - -#if gbk_ide_msv == cur_ide -#include "WRMSCFLS.i" -#endif - -#if gbk_ide_lcc == cur_ide -#include "WRLCCFLS.i" -#endif - -#if gbk_ide_dvc == cur_ide -#include "WRDVCFLS.i" -#endif - -#if gbk_ide_xcd == cur_ide -#include "WRXCDFLS.i" -#endif - -#if gbk_ide_dmc == cur_ide -#include "WRDMCFLS.i" -#endif - -#if gbk_ide_plc == cur_ide -#include "WRPLCFLS.i" -#endif - -#if gbk_ide_ccc == cur_ide -#include "WRCCCFLS.i" -#endif +#include "makefiles/makefiles.h" #if NeedSegmenting #pragma segment Body4 diff --git a/setup/CMDARGT1.i b/setup/utilities/CMDARGT1.c similarity index 98% rename from setup/CMDARGT1.i rename to setup/utilities/CMDARGT1.c index c165a72..b1c252f 100644 --- a/setup/CMDARGT1.i +++ b/setup/utilities/CMDARGT1.c @@ -20,6 +20,7 @@ used to make an MPW tool. */ +#include "COREDEFS.h" LOCALVAR int The_argc; LOCALVAR int The_argi; diff --git a/setup/STRUTILS.i b/setup/utilities/STRUTILS.c similarity index 99% rename from setup/STRUTILS.i rename to setup/utilities/STRUTILS.c index 4f92519..09079fc 100644 --- a/setup/STRUTILS.i +++ b/setup/utilities/STRUTILS.c @@ -19,6 +19,8 @@ Some very basic string macros and routines. */ +#include "COREDEFS.h" + #define PStrLength(s) (*(s)) #define PStrToMyCharPtr(s) ((s) + 1)