⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 LINUX 下的intel 810 TO TV的源代码,结合芯片CHRONTEL使用
💻
字号:
#  Makefile - Makefile for a CH700x Linux module.#  Based on a Makefile for lm_sensors by Frodo Looijaard <frodol@dds.nl>##  This program is free software; you can redistribute it and/or modify#  it under the terms of the GNU General Public License as published by#  the Free Software Foundation; either version 2 of the License, or#  (at your option) any later version.##  This program is distributed in the hope that it will be useful,#  but WITHOUT ANY WARRANTY; without even the implied warranty of#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the#  GNU General Public License for more details.##  You should have received a copy of the GNU General Public License#  along with this program; if not, write to the Free Software#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.# Everything you may want to change is in the top of this file. Usually, you# can just use the defaults, fortunately.# You need a full complement of GNU utilities to run this Makefile succesfully;# most notably, you need bash, GNU make, flex (>= 2.5.1) and bison.# If your /bin/sh is not bash, change the below definition so that make can# find bash. Or you can hope your sh-like shell understands all scripts.# I think so, but I have not tested it.# SHELL=/usr/bin/bash# The location of linux itself. This is used to find the kernel headers# and other things.LINUX=/usr/src/linuxLINUX_HEADERS=$(LINUX)/include# Determine whether we need to compile the kernel modules, or only the# user-space utilities. By default, the kernel modules are compiled.#COMPILE_KERNEL := 0COMPILE_KERNEL := 1# If you have installed the i2c header at some other place (like # /usr/local/include/linux), set that directory here. Please check this out# if you get strange compilation errors; the default Linux i2c headers# may be used mistakenly. Note: This should point to the directory# *above* the linux/ subdirectory, so to /usr/local/include in the# above example.I2C_HEADERS=/usr/local/include#I2C_HEADERS=$(LINUX_HEADERS)# Uncomment the third line on SMP systems if the magic invocation fails. It# is a bit complicated because SMP configuration changed around kernel 2.1.130SMP := $(shell if grep -q '^SMP[[:space:]]*=' $(LINUX)/Makefile || \                  grep -q '^[[:space:]]*\#define[[:space:]]*CONFIG_SMP[[:space:]]*1' $(LINUX_HEADERS)/linux/autoconf.h ; \               then echo 1; else echo 0; fi)#SMP := 0#SMP := 1# Uncomment the second or third line if the magic invocation fails.# We need to know whether CONFIG_MODVERSIONS is defined.MODVER := $(shell if cat $(LINUX_HEADERS)/linux/config.h $(LINUX_HEADERS)/linux/autoconf.h 2>/dev/null | grep -q '^[[:space:]]*\#define[[:space:]]*CONFIG_MODVERSIONS[[:space:]]*1'; then echo 1; else echo 0; fi)#MODVER := 0#MODVER := 1# Uncomment the second line if you are a developer. This will enable many# additional warnings at compile-timeWARN := 0#WARN := 1# Uncomment the second line if you want to get (loads of) debug information# at run-time.# Not recommended, unless you are actually debugging the codeDEBUG := 0#DEBUG := 1# If you want to install at some other place then at from which you will run# everything, set DESTDIR to the extra prefix.DESTDIR :=# This is the prefix that will be used for almost all directories below.PREFIX := /usr/local# This is the directory into which the modules will be installed.# The magic invocation will return something like this:#   /lib/modules/2.2.15-ac9/misc# MODDIR := /lib/modules/`grep UTS_RELEASE $(LINUX_HEADERS)/linux/version.h|cut -f 2 -d'"'`/miscMODPREF := /lib/modules/`grep UTS_RELEASE $(LINUX_HEADERS)/linux/version.h|cut -f 2 -d'"'`# This is the directory where sensors.conf will be installed, if no other# configuration file is foundETCDIR := /etc# You should not need to change this. It is the directory into which the# library files (both static and shared) will be installed.LIBDIR := $(PREFIX)/lib# You should not need to change this. It is the directory into which the# executable program files will be installed. BINDIR for programs that are# also useful for normal users, SBINDIR for programs that can only be run# by the superuser.# Note that not all programs in this package are really installed;# some are just examples. You can always install them by hand, of# course.BINDIR := $(PREFIX)/binSBINDIR := $(PREFIX)/sbin# You should not need to change this. It is the basic directory into which# include files will be installed. The actual directory will be # $(INCLUDEDIR)/linux for system include files, and $(INCLUDEDIR)/sensors# for library include files. If PREFIX equals the default /usr/local/bin,# you will be able to use '#include <linux/sensors.h>' regardless of the# current kernel selected.INCLUDEDIR := $(PREFIX)/includeSYSINCLUDEDIR := $(INCLUDEDIR)/linuxLIBINCLUDEDIR := $(INCLUDEDIR)/sensors# You should not need to change this. It is the base directory under which the# manual pages will be installed.MANDIR := $(PREFIX)/man# You should not need to change this. It defines the manual owner and group# as which manual pages are installed.MANOWN := rootMANGRP := rootMACHINE := $(shell uname -m)# Extra non-default programs to build; e.g., sensord# PROG_EXTRA := sensord# Set these to add preprocessor or compiler flags, or use# environment variables# CFLAGS :=# CPPFLAGS :=################################################### Below this, nothing should need to be changed. #################################################### Note that this is a monolithic Makefile; it calls no sub-Makefiles,# but instead, it compiles everything right from here. Yes, there are# some distinct advantages to this; see the following paper for more info:#   http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html# Note that is still uses Makefile fragments in sub-directories; these# are called 'Module.mk'.# Within each Module.mk, rules and dependencies can be added to targets# all, install and clean. Use double colons instead of single ones# to do this. # The subdirectories we need to build things in SRCDIRS := .# Some often-used commands with default optionsMKDIR := mkdir -pRM := rm -fCC := gccBISON := bisonFLEX := flexAR := arINSTALL := installLN := ln -sfnGREP := grep# Determine the default compiler flags# Set CFLAGS or CPPFLAGS above to add your own flags to all.# ALLCPPFLAGS/ALLCFLAGS are common flags, plus any user-specified overrides from the environment or make command line.# MODCPPFLAGS/MODCFLAGS is to create in-kernel object files (modules).# PROGCPPFLAGS/PROGCFLAGS is to create non-kernel object files (which are linked into executables).# ARCPPFLAGS/ARCFLAGS are used to create archive object files (static libraries).# LIBCPPFLAGS/LIBCFLAGS are for shared library objects.ALL_CPPFLAGS := -I. -Ikernel/include -I$(I2C_HEADERS) -I$(LINUX_HEADERS)ALL_CFLAGS := -O2 ifeq ($(DEBUG),1)ALL_CPPFLAGS += -DDEBUGendififeq ($(WARN),1)ALL_CFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \            -Wcast-align -Wwrite-strings -Wnested-externs -WinlineendifALL_CPPFLAGS += $(CPPFLAGS)ALL_CFLAGS += $(CFLAGS)MODCPPFLAGS :=MODCFLAGS :=ifeq ($(MACHINE),alpha)MODCFLAGS += -ffixed-8endififeq ($(SMP),1)MODCPPFLAGS += -D__SMP__endififeq ($(MODVER),1)MODCPPFLAGS += -DMODVERSIONS -include $(LINUX_HEADERS)/linux/modversions.hendifMODCPPFLAGS += -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -fomit-frame-pointer $(ALL_CPPFLAGS)MODCFLAGS += $(ALL_CFLAGS)PROGCPPFLAGS := $(ALL_CPPFLAGS)PROGCFLAGS := $(ALL_CFLAGS)ARCPPFLAGS := $(ALL_CPPFLAGS)ARCFLAGS := $(ALL_CFLAGS)LIBCPPFLAGS := $(ALL_CPPFLAGS)LIBCFLAGS := -fpic $(ALL_CFLAGS).PHONY: all clean install version package dep# Make all the default ruleall:: i810tv.o# Include all makefiles for sub-modules#INCLUDEFILES := #include $(patsubst %,%/Module.mk,$(SRCDIRS))#ifneq ($(MAKECMDGOALS),clean)#include $(INCLUDEFILES)#endif# Making the dependency files - done automatically!dep : all ::install :: allclean::	$(RM) *.o# .o files are used for modules%.o: %.c	$(CC) $(MODCPPFLAGS) $(MODCFLAGS) -c $< -o $@

⌨️ 快捷键说明

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