]> git.tuebingen.mpg.de Git - osl.git/commitdiff
build: Fix dependencies for oslfsck.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 19 Apr 2017 13:49:38 +0000 (15:49 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 19 Apr 2017 13:49:38 +0000 (15:49 +0200)
The autogenerated Makefile.deps does not work for the oslfsck
exectutable because we compile the object files for oslfsck without
-fPIC to generate more performant code, and name them e.g. util.fsck.o
instead of util.o.

Geting rid of this optimization not only fixes the dependencies but
also simplifies the Makefile and speeds up the build.

Makefile

index eeb5dcc54ef1ea5f6a86cadf711a33576fb8dbd7..25b06ea380c69a9edebc5f96541941431537a701 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ bindir := $(PREFIX)/bin
 mandir := $(PREFIX)/man/man1
 
 objects := osl.o util.o rbtree.o sha1.o
 mandir := $(PREFIX)/man/man1
 
 objects := osl.o util.o rbtree.o sha1.o
-fsck_objects := fsck.fsck.o osl.fsck.o util.fsck.o rbtree.fsck.o sha1.fsck.o fsck.cmdline.o
+fsck_objects := fsck.o osl.o util.o rbtree.o sha1.o fsck.cmdline.o
 headers := osl.h
 executables := oslfsck
 man_pages := oslfsck.1
 headers := osl.h
 executables := oslfsck
 man_pages := oslfsck.1
@@ -29,6 +29,8 @@ z := 3
 VERSION := $(x).$(y).$(z)
 
 # common flags
 VERSION := $(x).$(y).$(z)
 
 # common flags
+CPPFLAGS += -DVERSION='"$(VERSION)"'
+
 CFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
 CFLAGS += -Wredundant-decls
 CFLAGS += -Os
 CFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
 CFLAGS += -Wredundant-decls
 CFLAGS += -Os
@@ -120,10 +122,7 @@ osl.c fsck.c:
 -include Makefile.deps
 
 fsck.cmdline.o: fsck.cmdline.c fsck.cmdline.h
 -include Makefile.deps
 
 fsck.cmdline.o: fsck.cmdline.c fsck.cmdline.h
-       $(CC) -c -DVERSION='"$(VERSION)"' $<
-
-%.fsck.o: %.c Makefile fsck.cmdline.c fsck.cmdline.h osl.h errtab.h
-       $(CC) -c -DVERSION='"$(VERSION)"' $(CPPFLAGS) $(CFLAGS) $< -o $@
+       $(CC) $(CPPFLAGS) -c $<
 
 %.o: %.c Makefile errtab.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(LIBCFLAGS) $<
 
 %.o: %.c Makefile errtab.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(LIBCFLAGS) $<