文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Generic makefile - 通用的makefile

Generic makefile - 通用的makefile

时间:2007-04-06  来源:loughsky

######################################
#
# Generic makefile
#
# by George Foot
# email: [email protected]
#
# Copyright (c) 1997 George Foot
# All rights reserved.
#
# No warranty, no liability;
# you use this at your own risk.
#
# You are free to modify and
# distribute this without giving
# credit to the original author.
#
######################################

# Modified by Grip2 <[email protected]>

[separator]


### Customising
#
# Adjust the following if necessary; EXECUTABLE is the target
# executable's filename, and LIBS is a list of libraries to link in
# (e.g. alleg, stdcx, iostr, etc). You can override these on make's
# command line of course, if you prefer to do it that way.
#

EXECUTABLE := dt
LIBS := pcap dl iconv

# Now alter any implicit rules' variables if you like, e.g.:

CC := gcc
CFLAGS := -Wall -O2 -Iinclude/ -Werror
CXXFLAGS := $(CFLAGS)

# You shouldn't need to change anything below this point.

SOURCE := $(wildcard *.c */*.c */*/*.c */*/*/*.c)
OBJS := $(patsubst %.c,%.o,$(SOURCE))
DEPS := $(patsubst %.o,%.d,$(OBJS))
MISSING_DEPS := $(filter-out $(wildcard $(DEPS)),$(DEPS))
MISSING_DEPS_SOURCES := $(wildcard $(patsubst %.d,%.c,$(MISSING_DEPS)))
CPPFLAGS += -MD

.PHONY : everything deps objs clean veryclean rebuild

everything:$(EXECUTABLE)

deps:$(DEPS)

objs:$(OBJS)

clean:
    rm $(EXECUTABLE) -rf
    find ./ -name *.o -print -exec rm {} \;
    find ./ -name *.d -print -exec rm {} \;

rebuild : veryclean everything

ifneq ($(MISSING_DEPS),)
$(MISSING_DEPS) :
    rm $(patsubst %.d,%.o,$@) -rf
endif

-include $(DEPS)

$(EXECUTABLE) : $(OBJS)
    gcc -o $(EXECUTABLE) $(OBJS) $(addprefix -l,$(LIBS))
相关阅读 更多 +
排行榜 更多 +
房间毁灭模拟器最新版

房间毁灭模拟器最新版

休闲益智 下载
街头追逐者最新版

街头追逐者最新版

休闲益智 下载
弓箭手2内置作弊菜单

弓箭手2内置作弊菜单

休闲益智 下载