Makefile improved, added the log-save & verbose feature
[Cbot.git] / Makefile
blobd2b191370d0b43345013130bbc2761541121614a
1 #main :
2 # gcc cbot.c config.c b_socket.c irc_cmd.c log.c -o cbot -g -Wall -Wextra;
4 #clean :
5 # rm cbot
8 SRC_FILES = cbot.c config.c b_socket.c irc_cmd.c log.c
9 OBJ_FILES = $(patsubst %.c, %.o, ${SRC_FILES})
10 DEP_FILES = $(patsubst %.c, %.dep, ${SRC_FILES})
12 VPATH = ./
14 CFLAGS = -c -Wall -Wextra -g3
15 LDFLAGS = -g3
17 cbot: ${OBJ_FILES}
18 gcc ${LDFLAGS} -o cbot ${OBJ_FILES}
20 %.o:%.c
21 gcc ${CFLAGS} -o $@ $<
23 clean:
24 rm *.o cbot
26 cleanall:
27 rm *.o cbot *.dep
29 include ${DEP_FILES}
31 %.dep:%.c
32 @set -e; rm -f $@; \
33 gcc -MM $(CFLAGS) $< > $@.$$$$; \
34 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
35 rm -f $@.$$$$