############################################################################# # mined text editor compilation options (make include file for gcc options) ############################################################################# # compilation source options # Define if pedantic analysis wanted: #GFLAGS = -ansi -pedantic -Wall -Wtraditional -Wpointer-arith -Wconversion -Waggregate-return -Winline # For regular compilation: # Leave in extra flags that produce no warnings (covered by -Wall): # -Wimplicit-int -Wreturn-type -Wunused -Wswitch -Wchar-subscripts -Wparentheses # Leave out extra flags that produce some warnings: # -Wtraditional # -W -Wuninitialized (covered by -Wall) # Perhaps also leave out flag that produces extra warnings (Linux, ...?): # -Wconversion # (rotten C crap: value does match prototype, so why this silly # warning "passing arg ... with different width due to prototype" ??? # Perhaps also leave out flag that produces extra warnings (Linux, ...?): # -pedantic # (rotten C crap: prototype matches exactly, so why this silly # warning "promoted argument `c' doesn't match prototype" ??? GFLAGS = -ansi -Waggregate-return -Winline \ -Wimplicit-int -Wunused -Wswitch -Wchar-subscripts \ -Wparentheses -Wmissing-braces \ ${WFLAGS} $(W) # The following warnings are left out deliberately: # -Wreturn-type # causes obscure "error 1" on my Linux # -pedantic # causes junk messages about "braced groups" # -Wpointer-arith # causes junk messages from library include files # -Wconversion # causes junk messages from library include files # -Wall -W / -Wextra # Variable warning options: # add -Wno-pointer-sign for gcc > version 4 W = $(shell $(CC) -v 2>&1 | sed -e "s,gcc version [4-9].*,-Wno-pointer-sign," -e t -e d ) # Tune further -W options with the environment variable $WFLAGS # code checking # checking for function signatures: PROTOFLAGS= -Wmissing-prototypes -Wreturn-type ############################################################################# # compilation mode options (optimisation and debug) # Optimization flag/level: OPT = -O2 # Debugging option DEBUG = # -ggdb -gstabs ############################################################################# # compilation setup # Collection of compilation parameters: CFLAGS = $(SYSFLAGS) $(GFLAGS) $(OPT) $(DEBUG) ############################################################################# # link options LINKOPTS=$(GLDOPTS) # --warn-common? # for newer ncursesw? #LDL=-ldl # if libdl library exists: ldl_libs=$(shell echo "/usr/lib ${LDFLAGS} " | sed -e "s, -L, ,g" -e "s, ,/libdl.* ,g" ) LDL=$(shell ls $(ldl_libs) | sed -e "s,.*/libdl\..*,-ldl," -e 1q ) ############################################################################# # dynamic make targets # this version for GNU make # (if gcc is used, GNU make is also assumed) # derive list of character set mappings from source files: CHARMAPS=$(shell echo charmaps/*.map | sed -e "s,\.map,.o,g" ) # extract list of configured keyboard mappings from keymaps.cfg: KEYMAPS=$(shell ./mkkmlist ) # disable the explicit make targets for dynamically # generating and invoking makefiles MAKEMAPS= ############################################################################# # end