一个简单的makefile
CC = gcc
TARGET = main
ALLO = main.o
INCLUDE = ./include
${TARGET} : ${ALLO}
${CC} $^ -o $@
%.o : %.c
${CC} -c -g -Wall -I ${INCLUDE} $<
clean :
sudo rm *.o .*.*.swp ${TARGET} -rf
install :
sudo cp ${TARGET} /usr/opt/
tar :
sudo tar -cf ${TARGET}.tar.gz ./*