CFLAGS=-std=c99 -Wall
CC=gcc
hangman: hangman.o hangman.c
$(CC) $(CFLAGS) hangman.o hangman.c -o hangman
hangman.o: hangman.c
$(CC) $(CFLAGS) -c hangman.c
clean:
rm -f hangman *.o
尝试一下:
CFLAGS=-std=c99 -Wall
CC=gcc
OBJECTS = hangman.o
all: hangman
hangman.o: hangman.c
$(CC) $(CFLAGS) -c hangman.c
hangman: $(OBJECTS)
$(CC) $(OBJECTS) -o hangman
clean:
rm -f hangman *.o