Table of Contents

Various C Compiler Options

These instructions were tested on my Intel iMac.

Normal Compile

Normal compile to create an executable named hello from source file hello.c:

gcc -o hello hello.c

Create Assembly Language Listing Only

Produce only an assembly language file (not an executable) called hello.s from source file hello.c:

gcc -S hello.c

Create a C Listing Only

This method produces a C listing from the assembler, no executable is made.

gcc -E -fdirectives-only -o hello.lst hello.c