简单的Makefile写法

CC      = gcc
CFLAGS  = -g -Wall
LIBS    = -lpthread -lnetfilter_queue -lmnl 
INCLUDES= -I../../libnetfilter_queue-1.0.2/include/

main:nfqnl_test.o test.o
    gcc -o $@ $^ $(LIBS)
nfqnl_test.o: nfqnl_test.c
    cc $(CFLAGS) $(LIBS) $(INCLUDES) -c $<
test.o: test.c
    cc $(CFLAGS) $(LIBS) $(INCLUDES) -c $< 
clean:
    -rm *.o main
    

 

posted @ 2017-11-01 11:56  未命名blogs  阅读(132)  评论(0编辑  收藏  举报