targetdir=$(disk)
moddir=../..
modname=TestModule
modtarget=0x800000
modtype=kernal
slang-extra=-dblevel 0
include ../../makemod.$(OSTYPE)
all: $(targetdir)/$(module).kmd
clean: modclean
@ $(clean_backup)
@ -$(rm) test.kmd
include ../../../makefile.$(OSTYPE) |
these commands force make to get the default
definitions for this platform (where is gcc, ld, slang, etc.) The file referenced
is src/makefile.$(ostype) where ostype is the tag defining your
platform (usually DOS :) Remember to correct those dots so that they match your path. |
modsources=test.c |
Tells the module makefile what are your sourcefiles.
here, the only file was test.c ... only files that are processed by gcc should
be put here. If you have some other files (c++, assembly, whatever ..), you'll
have to compile them by yourself and put their object-file names into the
$(modothers) make variable |
module=test |
Tell the module devkit what should be the name for
the generated module. this means our module will be test.kmd, and
that intermediate files test.mo (coff version) and test.map
(linking resume) will be available |
targetdir=$(disk) |
tells make where it should put the generated module.
We usually want it to be placed in disk/* directory, which is held by
$(disk) |
moddir=../.. |
give make the relative path to the src/mods/ directory
where it could have to pick some helper files. |
modname=TestModule |
arguments for the module maker. They are quite straightforward
except that modtarget is a wish from the module: it might be (and
with kds 1.x, it will be) relocated somewhere else. Only two mod types
are available for now: kernal and system. |
slang-extra=-dblevel 0 |
these are extra flags you can give to slang
: the server-language compiler. They mainly allow you to control the debug
output through -dblevel, -dbmask, -dbfile and
-dbnokey options. Use slang --help for more infos |
include ../../makemod.$(OSTYPE) |
now this is the real thing. You'll be including
the module development kit right now, which will extends make and learn it
how to produce $(module).kmd out of $(modsources) and
$(modothers). remember to patch the path so that it matches your location
(the file is located under src/mods/) |
|
And here comes the 'normal' part of your module, put
everything you now about makefiles right here: these rules are yours! Here, we simply ask to produce the module and to put it in disk/ remember to provide a clean: target. modclean and clean_backup can help you doing it. Remember that your command have to work both on Linux and Dos. usual $(RM) *~ on dos usually deletes the makefile too, so you have the platform-dependent $(clean_backup) command to help you :) |