X-Git-Url: http://git.tuebingen.mpg.de/?p=lopsub.git;a=blobdiff_plain;f=Makefile;h=548c96ff0e6298e29d8f247940a4f446e6757d35;hp=31c2102a940a2ec372f78d5906e9da48852d6fc7;hb=HEAD;hpb=c1840c5bb555ba09c09bdeb2f29305681038317f diff --git a/Makefile b/Makefile index 31c2102..89cbc2e 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,8 @@ INSTALL := install GZIP := gzip -fn9 ZCAT := zcat +CC += -ffile-prefix-map=$(CURDIR)=. + dummy != $(M4) /dev/null || printf 'failed' ifeq ($(dummy), failed) $(error m4 is required to build this package) @@ -95,13 +97,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) @@ -110,6 +116,9 @@ lopsubgen: $(lsg_objs) $(CC) -Wall -g -o $@ $(lsg_objs) $(REALNAME): $(liblopsub_objs) $(CC) --shared -Wl,-soname,liblopsub.so.$(MAJOR_VERSION) -o $@ $^ +liblopsub.a: $(liblopsub_objs) + $(AR) -rcs $@ $^ + lopsubex: $(lopsubex_objs) $(REALNAME) $(CC) -Wall -g -o $@ $(lopsubex_objs) @@ -145,4 +154,4 @@ clean: distclean: clean $(RM) *.lsg.c *.lsg.h lopsubgen.c config_file.c lopsubgen-stage1 \ lopsub.h lopsub.7 lopsub-suite.5 version.c - +-include Makefile.local