怎么写一个简单的makefile

43 阅读1分钟

define the compiler to use

CC = gcc

define compile-time flags

CFLAGS = -Wall -g

define the target executable

TARGET = myprogram

all: $(TARGET)

(TARGET):myprogram.c(TARGET): myprogram.c (CC) (CFLAGS)o(CFLAGS) -o (TARGET) myprogram.c

clean: (RM)(RM) (TARGET)