tytso@MIT.EDU wrote:
> ../linux
I really like this one, I work a lot with embedded systems and I've
patched most of my development trees to use this convention. It means
that I can just check out my CVS tree and get identical binaries
(assuming the same compilers are used) anyway.
For example, this is how the top directory looks for a small system
using a Disk On Chip (DOC) flash and a PCMCIA controller:
bash$ ls /export/project:
CVS/ flash_doc/ pcmcia_cs/
Makefile linux/
And then the Makefile for the DOC looks like this, the TOPDIR define
is the important one, and to get the right compile options I'm using a
trick I think I've learned from the linux-mtd package:
===
# Makefile for a block device driver
# for the DiskOnChip flash module from M-Systems
#
# Copyright (C) 1998 IGEL GmbH
ifndef TOPDIR
TOPDIR:=$(shell cd ../linux && pwd)
endif
all:
make -C $(TOPDIR) SUBDIRS=`pwd` modules
clean:
rm -f *.o .*.flags
O_TARGET := fl.o
O_OBJS := flobj.o fldrvlnx.o
M_OBJS = $(O_TARGET)
MOD_LIST_NAME := NO_MODULES
fl.o: flobj.o
flobj.o: flobj.obj
rm -f flobj.o
cat flobj.obj >flobj.o
# Real actions are started from Rules.make
include $(TOPDIR)/Rules.make
===
So for a naive user who just wants to compile a module on his RedHat
system, tell him to unpack the module into /usr/src and assuming that
/usr/src/linux contains the current kernel source it'll just work.
For those who want to do special tricks it's always possible to do a:
TOPDIR=/usr/src/linux-2.2.17pre6 make
to use a specific kernel.
/Christer
-- "Just how much can I get away with and still go to heaven?"- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:24 EST