makefile

来自「Linux平台环境下」· 代码 · 共 59 行

TXT
59
字号
CC=gcc
PRG=spalarm
RM=rm
FLAGS=-pipe -Wall -Wstrict-prototypes

#if we are debuging
FLAGS+=-g

#if we are not
#FLAGS+= -O3 -m486 -finline-functions -fkeep-inline-functions -funroll-loops

#some libs we need
LIBS=-lpthread
LIBS+=-lncurses
LIBS+=-L /usr/lib/mysql -lmysqlclient

#Debuging Libs
#LIBS+=-lncurses_g
#LIBS+=-lefence

#some defines we need
#FLAGS+=-D_REENTRANT

INCLUDE=-I./ -I/usr/include/mysql -L/usr/lib

#What stuff needs compiled!
OBJS= 	cc_configfile_operate.o \
	cc_mailcontrol.o \
	spalarm.o   \

#	proto/http.o 	\
#	proto/pop3.o

SRCS=$(OBJS:%.o=%.c)

all: $(PRG)

$(PRG): $(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) -o $(PRG) $(LIBS)

.c.o:
	$(CC) $(FLAGS) $(INCLUDE) -c $< -o $@

dep: depend

depend:
#	gcc -E -MM $(FLAGS) $(INCLUDE) $(SRCS) > .depend
	makedepend -f- -Iheaders $(SRCS) > .depend

ifeq (.depend,$(wildcard .depend))
include .depend
endif


clean: 
	-rm -f $(OBJS)
	-rm -f $(PRG)
	-rm -f core

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?