空格为tab!!!
C
#Source file
SRC = $(shell find ./ -name "*.c")
#Object file
OBJ = $(SRC:.c=.o)
#Output execution file
PROGRAM =output
#Compiler
CC = gcc
#Include
INCLUDE = -I/usr/include/ncurses -I/usr/include/
#Linker Parameter
LINKPARAM = -lpthread -lncurses
#Options for development
#CFLAGS = -ansi -g -Wall
#Options for release
CFLAGS = -ansi -O -Wall
: $(PROGRAM)
$(PROGRAM): $(OBJ)
$(CC) -o $(PROGRAM) $(OBJ)
SUFFIXES : .c
cpp.o:
$(CC) $(INCLUDE) $(CFLAGS) -c $<
clean:
@rm -rf $(OBJ) $(PROGRAM)
C++
#Source file
SRC = $(shell find ./ -name "*.cpp")
#Object file
OBJ = $(SRC:.cpp=.o)
#Output execution file
PROGRAM =output
#Compiler
CC = g++
#Include
INCLUDE = -I/usr/include/ncurses -I/usr/include/
#Linker Parameter
LINKPARAM = -lpthread -lncurses
#Options for development
#CFLAGS = -ansi -g -Wall
#Options for release
CFLAGS = -ansi -O -Wall
: $(PROGRAM)
$(PROGRAM): $(OBJ)
$(CC) -o $(PROGRAM) $(OBJ)
SUFFIXES : .cpp
cpp.o:
$(CC) $(INCLUDE) $(CFLAGS) -c $<
clean:
@rm -rf $(OBJ) $(PROGRAM)