Hi Tom,

> Let the Makefile be a bit more verbose and remove unnecessary extensions
> and flags in config.mk.
> ---
  
>  cscope: ${SRC} config.h
>       @echo cScope
> -     @cscope -R -b || echo cScope not installed
> +     cscope -R -b || echo cScope not installed

I think that you can also drop the || altogether,
make will just tell you whatever problem it encountered
while trying to invoque cscope.

> -     @mkdir -p ${DESTDIR}${MANPREFIX}/man1
> -     @cp sent.1 ${DESTDIR}${MANPREFIX}/man1/sent.1
> -     @chmod 644 ${DESTDIR}${MANPREFIX}/man1/sent.1
> +     mkdir -p ${DESTDIR}${MANPREFIX}/man1
> +     cp sent.1 ${DESTDIR}${MANPREFIX}/man1/sent.1

I'd cp -f here too.

>  # includes and libs
> -INCS = -I. -I/usr/include -I/usr/include/freetype2 -I${X11INC}
> -LIBS = -L/usr/lib -lc -lm -L${X11LIB} -lXft -lfontconfig -lX11
> +INCS = -I/usr/include/freetype2 -I${X11INC}
> +LIBS = -lm -L${X11LIB} -lXft -lfontconfig -lX11

The -L option should go into LDFLAGS

>  # flags
>  CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600
> -CFLAGS += -g -std=c99 -pedantic -Wall ${INCS} ${CPPFLAGS}
> -LDFLAGS += -g ${LIBS}
> -#CFLAGS += -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
> -#LDFLAGS += ${LIBS}
> +CFLAGS = -std=c99 -pedantic -Wall -Wstrict-prototypes -Wold-style-definition 
> -Os ${INCS} ${CPPFLAGS}

The -std option isn't necessary with the default CC.
I'd remove any warning from production build,
warnings are for development,
then developpers can set whatever warnings they like.

>  # compiler and linker
> -CC ?= cc
> +CC = cc

This should be removed altogether if you want a standard Makefile,
then CC will just be the expected c99.

Reply via email to