X-Git-Url: http://git.tuebingen.mpg.de/?p=lopsub.git;a=blobdiff_plain;f=Makefile;h=548c96ff0e6298e29d8f247940a4f446e6757d35;hp=c0057a38b89119897044caa0a1eaa705877989ca;hb=45901057b4103eeb745e080521678c0e43e0eca1;hpb=7623e601612eb36cf86511b40fef3f5a20e8b834 diff --git a/Makefile b/Makefile index c0057a3..548c96f 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,13 @@ endif .ONESHELL: .SHELLFLAGS := -ec +# Recipes which redirect stdout to the target of the rule (i.e., constructs +# like cmd > $@) create empty or incomplete output files if the command fails, +# for example when cmd was not found. Since the target exists and is uptodate +# in this case, this may lead to all sorts of problems. The following target +# makes sure that such files are removed. +.DELETE_ON_ERROR: + PREFIX ?= /usr/local M4 := m4 LN := ln -f @@ -88,13 +95,17 @@ lsg_objs := lopsubgen.o lsg.o lopsubgen.lsg.o lopsub.o version.o liblopsub_objs := config_file.o lopsub.o version.o lopsubex_objs := lopsubex.o lopsubex.lsg.o $(liblopsub_objs) +LLS_CFLAGS := -g -fPIC +STRICT_CFLAGS := -Wall +STRICT_CFLAGS += -Werror-implicit-function-declaration + $(lsg_objs) $(liblopsub_objs) $(lopsubex_objs): %.o: %.c lopsubgen.o config_file.o: - $(CC) -g -c -fPIC -o $@ ${@:.o=.c} + $(CC) $(CPPFLAGS) $(LLS_CFLAGS) $(CFLAGS) -c -o $@ ${@:.o=.c} lsg1.o: lsg.c lsg.h - $(CC) -g -DSTAGE1 -Wall -c $< -o $@ + $(CC) $(CPPFLAGS) $(LLS_CFLAGS) $(STRICT_CFLAGS) $(CFLAGS) -DSTAGE1 -c -o $@ $< %.o: %.c - $(CC) -Wall -I. -g -c -fPIC -o $@ $< + $(CC) -I. $(CPPFLAGS) $(LLS_CFLAGS) $(STRICT_CFLAGS) $(CFLAGS) -c -o $@ $< # linking lopsubgen-stage1: $(lsg1_objs)