Category : BASIC Source Code
Archive   : SMAK126.ZIP
Filename : SMAK_C.DOC

 
Output of file : SMAK_C.DOC contained in archive : SMAK126.ZIP

Using SMAK with C source files


SMAK works with C, too! The /2 command line parameter can be used
to specify Microsoft C compiler format.

Note: My knowledge of C is limited to Microsoft's Quick C 2.0, which is
the only C compiler I have tested SMAK with. I would appreciate any
information that others can provide me with on other C compilers.



Entering "SMAK hello.c /2" command at the DOS prompt will "make" the
following sample C program. Note the QCL compiler /c switch that tells
the QCL compiler not to pass the object files to the linker automatically,
since SMAK will do this.



/* =================== Begin program HELLO.C =================== */

#include

/* Note that SMAK directives are commented off. */

/*

'begin MAKE
' c:\qc2\bin\qcl 'compiler program
' c:\qc2\bin\link 'linker program and options
' begin C 'source file default extension - source list follows
' c:\qc2\samples\hello /c ' main source module with compile options
' begin OBJ 'object file default extension - object list follows
' begin LIB
' c:\qc2\lib\slibce 'linker library
'end MAKE

*/


main()
{
printf (" HELLO! (compiled and linked with SMAK, written in Quick C 2.0)");
}


/* ==================== End program HELLO.C ==================== */


Alternately, you could rely on the QCL program to do the linking, rather
than SMAK, by using the following make directives:

/*

'begin MAKE
' c:\qc2\bin\qcl 'compiler program
' 'no linker program, QCL handles linking
' begin C 'default source extension - source list follows
' c:\qc2\samples\hello ' main source module with compile options
'end MAKE

*/

This is not desirable, however, as all compiler options and link commands
would have to be specified on a single line along with the main source
module, just as you would do from the command line. For more complex,
multi-module programs, the first SMAK script is more manageable and
clearer. The organized, columnar approach that SMAK uses makes it
preferable to the QCL spaghetti-code method.


  3 Responses to “Category : BASIC Source Code
Archive   : SMAK126.ZIP
Filename : SMAK_C.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/