# # Do the following to start a new project: # - replace ods_c with the name of your Project, # - set implementation language suffix (c or cc) # - set the Directories, # - set CC appropiate, # - CFLAGS appropiate, # - if your project is written in c++ uncomment the # MOD_SYMS macro, # - set latex command, # - set your dvi to Postscript translator command and # - set the command to preview dvi files. # PROJ_NAME = rt_fix # the implementation language LANG = c # the path to include files INCLUDE = /usr/local/include # Directory where project binaries are kept PROJ_BIN = ../bin # Directory where project libraries are kept PROJ_LIB = ../lib # Directory where project documentatoion is kept PROJ_DOC = ../doc # Directory where project includes are kept PROJ_INCLUDE = ../include # Directory where project sources are kept PROJ_SRC = ../src # dvi to Postscript translator # assumes any other translator has a -o option, too. DVIPS = dvips # Previewer for dvi Files. PREVIEWER = xdvi CC = gcc K_CFLAGS = -I${INCLUDE} -I${PROJ_INCLUDE} -O2 -Wall -D__KERNEL__ -D__RT__ #L_CFLAGS = -I${INCLUDE} -I${PROJ_INCLUDE} -O2 -Wall -g L_CFLAGS = -I${INCLUDE} -I${PROJ_INCLUDE} -O2 -Wall # generate cleanup_module and init_module symbols for the c++ kernel module #MOD_SYMS = mv $@ $@.tmp; \ # ld -o $@ $@.tmp -r \ # -defsym cleanup_module=cleanup_module__Fv \ # -defsym init_module=init_module__Fv; \ # rm -f $@.tmp # Header for this project HDR= ${PROJ_INCLUDE}/${PROJ_NAME}.h SRC= ${PROJ_SRC}/${PROJ_NAME}.${LANG} # library of this project LIB= ${PROJ_LIB}/lib${PROJ_NAME}.so # Objects of this project OBJ= ${PROJ_BIN}/${PROJ_NAME}.o # begin of rules all: documentation compile # In this section documentation, source and header is created documentation: ${HDR} ${SRC} \ ${PROJ_DOC}/${PROJ_NAME}.tex \ ${PROJ_DOC}/${PROJ_NAME}.dvi \ ${PROJ_DOC}/${PROJ_NAME}.ps ${HDR}: ${PROJ_NAME}.nw notangle -L -RPROVIDED $? > $@ ${SRC}: ${PROJ_NAME}.nw notangle -L -RINTERNA $? > $@ ${PROJ_DOC}/${PROJ_NAME}.tex: ${PROJ_NAME}.nw noweave -delay -index $? > $@ ${PROJ_DOC}/${PROJ_NAME}.dvi: ${PROJ_DOC}/${PROJ_NAME}.tex latex $? latex $? mv ${PROJ_NAME}.dvi ${PROJ_DOC}/${PROJ_NAME}.dvi ${PROJ_DOC}/${PROJ_NAME}.ps: ${PROJ_DOC}/${PROJ_NAME}.dvi ${DVIPS} -o ${PROJ_DOC}/${PROJ_NAME}.ps $? preview: ${PROJ_DOC}/${PROJ_NAME}.dvi ${PREVIEWER} $? & # In this section the compilation takes place compile: ${LIB} ${OBJ} ${LIB}: ${HDR} ${SRC} ${CC} ${L_CFLAGS} -c ${SRC} -o ${OBJ} ld -lm -shared -o $@ ${OBJ} rm -f ${OBJ} ${OBJ}: ${HDR} ${SRC} ${CC} ${K_CFLAGS} -c ${SRC} -o $@ ${MOD_SYMS} clean: rm -f ${PROJ_DOC}/${PROJ_NAME}.tex \ rm -f ${PROJ_DOC}/${PROJ_NAME}.dvi \ rm -f ${PROJ_DOC}/${PROJ_NAME}.ps \ rm -f ${LIB} \ rm -f ${OBJ} \ rm -f ${SRC} \ rm -f ${HDR} \ rm -f *.log \ rm -f *.aux