]> git.tuebingen.mpg.de Git - osl.git/blobdiff - Makefile
build: Make sure osl.h exists when we run the compiler.
[osl.git] / Makefile
index 61ac1dc9529448764196bfaff0d8fa35d6c8a839..d0427c6aef05d21b7752832c6ae282268d9f90f4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -66,20 +66,23 @@ realname := $(soname).$(y).$(z)
 # soname without any version number.
 linkername := lib$(libname).so
 
-all: $(realname) $(executables) $(man_pages)
+all: $(realname) $(executables) $(man_pages) $(headers)
 shared: $(realname)
 
 ifeq ($(findstring clean, $(MAKECMDGOALS)),)
 -include $(deps)
 endif
-%.o: %.c Makefile errtab.h
+
+# List osl.h in the prerequisites to make sure we generate it before attempting
+# to run the compiler. This matters only when the .d file does not exist.
+%.o: %.c osl.h Makefile errtab.h
        $(CC) $(OSL_CPPFLAGS) $(CPPFLAGS) \
                -c -MMD -MF $(*F).d -MT $@ \
                $(OSL_CFLAGS) $(CFLAGS) $<
 
 fsck.o: oslfsck.lsg.h
 oslfsck: $(fsck_objects)
-       $(CC) -o $@ $(fsck_objects) -llopsub
+       $(CC) -o $@ $(fsck_objects) $(LDFLAGS) -llopsub
 
 %.lsg.c: %.suite
        lopsubgen --gen-c < $<