in handwritten rules too, hopefully fix the build
of ldb with bsd make.
metze
}
$self->output(<< "__EOD__"
}
$self->output(<< "__EOD__"
+FIRST_PREREQ = $first_prereq
+
# Dependencies command
DEPENDS = \$(CC) -M -MG -MP -MT \$(<:.c=.o) -MT \$@ \\
`\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
# Dependencies command
DEPENDS = \$(CC) -M -MG -MP -MT \$(<:.c=.o) -MT \$@ \\
`\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) $first_prereq -o \$@
+ \$(CFLAGS) \$(FIRST_PREREQ) -o \$@
# Dependencies for host objects
HDEPENDS = \$(CC) -M -MG -MP -MT \$(<:.c=.ho) -MT \$@ \\
`\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
# Dependencies for host objects
HDEPENDS = \$(CC) -M -MG -MP -MT \$(<:.c=.ho) -MT \$@ \\
`\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(HOSTCC_CFLAGS) $first_prereq -o \$@
+ \$(HOSTCC_CFLAGS) \$(FIRST_PREREQ) -o \$@
# Dependencies for precompiled headers
PCHDEPENDS = \$(CC) -M -MG -MT include/includes.h.gch -MT \$@ \\
# Dependencies for precompiled headers
PCHDEPENDS = \$(CC) -M -MG -MT include/includes.h.gch -MT \$@ \\
- \$(CFLAGS) $first_prereq -o \$@
+ \$(CFLAGS) \$(FIRST_PREREQ) -o \$@
# \$< is broken in older BSD versions:
# when \$@ is foo/bar.o, \$< could be torture/foo/bar.c
# \$< is broken in older BSD versions:
# when \$@ is foo/bar.o, \$< could be torture/foo/bar.c
# Run a static analysis checker
CHECK = \$(CC_CHECKER) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
# Run a static analysis checker
CHECK = \$(CC_CHECKER) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) \$(PICFLAG) -c $first_prereq -o \$@
+ \$(CFLAGS) \$(PICFLAG) -c \$(FIRST_PREREQ) -o \$@
# Run the configured compiler
COMPILE = \$(CC) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
# Run the configured compiler
COMPILE = \$(CC) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) \$(PICFLAG) -c $first_prereq -o \$@
+ \$(CFLAGS) \$(PICFLAG) -c \$(FIRST_PREREQ) -o \$@
# Run the compiler for the build host
HCOMPILE = \$(HOSTCC) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
# Run the compiler for the build host
HCOMPILE = \$(HOSTCC) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(HOSTCC_CFLAGS) -c $first_prereq -o \$@
+ \$(HOSTCC_CFLAGS) -c \$(FIRST_PREREQ) -o \$@
# Precompile headers
PCHCOMPILE = @\$(CC) -Ilib/replace \\
`\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
# Precompile headers
PCHCOMPILE = @\$(CC) -Ilib/replace \\
`\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) \$(PICFLAG) -c $first_prereq -o \$@
+ \$(CFLAGS) \$(PICFLAG) -c \$(FIRST_PREREQ) -o \$@
dynconfig.o: dynconfig.c Makefile
@echo Compiling $<
dynconfig.o: dynconfig.c Makefile
@echo Compiling $<
- @$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) $(PATH_FLAGS) -c $< -o $@
+ @$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) \
+ $(PATH_FLAGS) -c $(FIRST_PREREQ) -o $@
# End MODULE ldb_tdb
################################################
# End MODULE ldb_tdb
################################################
-# NOTE: this rule is broken for some systems when $builddir != $srcdir because
-# it hardcodes the use of $<. See smb_build/makefile.pm.
./lib/ldb/common/ldb_modules.o: lib/ldb/common/ldb_modules.c Makefile
@echo Compiling $<
@$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) \
-DSHLIBEXT=\"$(SHLIBEXT)\" \
./lib/ldb/common/ldb_modules.o: lib/ldb/common/ldb_modules.c Makefile
@echo Compiling $<
@$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) \
-DSHLIBEXT=\"$(SHLIBEXT)\" \
+ -c $(FIRST_PREREQ) -o $@
./lib/ldb/common/ldb.o: lib/ldb/common/ldb.c Makefile
@echo Compiling $<
@$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) \
-DLDB_MODULESDIR=\"$(MODULESDIR)/ldb\" \
./lib/ldb/common/ldb.o: lib/ldb/common/ldb.c Makefile
@echo Compiling $<
@$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) \
-DLDB_MODULESDIR=\"$(MODULESDIR)/ldb\" \
+ -c $(FIRST_PREREQ) -o $@
################################################
################################################