在实用C编程,第7章编程过程一书中,有一个makefile:
File: calc1/makefile.gcc
#-----------------------------------------------#
# Makefile for unix systems #
# using a GNU C compiler #
#-----------------------------------------------#
CC=gcc
CFLAGS=-g -D__USE_FIXED_PROTOTYPES__ -ansi
#
# Compiler flags:
# -g -- Enable debugging
# -Wall -- Turn on all warnings (not used since it gives away
# the bug in this program)
# -D__USE_FIXED_PROTOTYPES__
# -- Force the compiler to use the correct headers
# -ansi -- Don't use GNU extensions. Stick to ANSI C.
calc1: calc1.c
$(CC) …Run Code Online (Sandbox Code Playgroud)