./0040755000076400001440000000000007674664564010307 5ustar gholtusers./Makeppfile0100644000076400001440000000025607674664523012302 0ustar gholtusers# # This test depends entirely on the builtin rules. # $(phony clean): $(RM) -rf .makepp* compilation_test compilation_test.* iteration_? n_files_? *~ */*~ subdir*/*.h ./x2.h0100644000076400001440000000006007672470730010766 0ustar gholtusers/* This file should be ignored. */ #define X2 3 ./is_relevant0100755000076400001440000000030507672470054012526 0ustar gholtusers#!/bin/sh # # The C compilation tests will all fail if the MD5 module is not installed. # Test for that here: # ${PERL-perl} -e 'use Digest::MD5;' # Should return error code if not available. ./makepp_test_script0100755000076400001440000000335307674664552014133 0ustar gholtusers#!/bin/sh # # Tests several things about C compilation: # 1) Correctly scanning command lines for include files. # 2) Correctly calculating checksums so if files change we do not # rebuild, but we always rebuild when necessary. # 3) Tests the builtin rules. # # This makefile depends on the existence of a C compiler. # MAKEPP="${PERL-perl} ${1-makepp}" # Grab the path to makepp. # # Replace the .c file multiple times and see which replacements trigger a # rebuild. # for iter in 0 1 2 3; do echo "**** Iteration $iter" cp compilation_test_$iter.c compilation_test.c $MAKEPP CPPFLAGS="-I subdir1 -Isubdir2" compilation_test || exit 1 # We test both the "-I subdir" and "-Isubdir" # syntax. ./compilation_test > iteration_$iter ${PERL-perl} -ne 'BEGIN { $exitstatus = 1; } if (m@subdir1/x2\.h@) { $exitstatus = 0 }; END { exit $exitstatus }' .makepp/compilation_test.o || exit 2 # Make sure makepp found x2 in subdir1, not # in the main directory. ${PERL-perl} -ne 'if (/warning: can.t locate file/) { exit 1 }' .makepp_log || exit 3 # Make sure makepp correctly found all include files. ${PERL-perl} -ne 'if (/(\d+) files updated/) { print "$1\n"; }' .makepp_log > n_files_$iter # Count how many files were build. sleep 2 # Guarantee that the file times have changed. # Sometimes this test runs fast enough so that # the .o file has the same time as it did # before. done exit 0 ./subdir1/0040755000076400001440000000000007674664474011660 5ustar gholtusers./subdir1/Makeppfile0100644000076400001440000000016207672712342013636 0ustar gholtusersx.h: echo '#define X 1' > $(output) echo '#include "x2.h"' >> $(output) x2.h: echo '#define X2 2' > $(output) ./subdir1/.makepp/0040755000076400001440000000000007674663266013211 5ustar gholtusers./subdir1/.makepp/x.h0100644000076400001440000000036707674663266013634 0ustar gholtusersINCLUDES=x2.h SORTED_DEPS= SYSTEM_INCLUDES= BUILD_SIGNATURE=1056138934 C_MD5_SUM=cfa657148d1cf23f233f30badb348394 CWD=.. COMMAND=echo '#define X 1' > x.h\012echo '#include "x2.h"' >> x.h ARCH=i586-linux-thread-multi DEP_SIGS= SIGNATURE=1056138934 ./subdir1/.makepp/x2.h0100644000076400001440000000032407674663266013707 0ustar gholtusersINCLUDES= SORTED_DEPS= SYSTEM_INCLUDES= BUILD_SIGNATURE=1056138934 C_MD5_SUM=953949fcc3fa2a79fcd6e282236dd3e7 CWD=.. COMMAND=echo '#define X2 2' > x2.h ARCH=i586-linux-thread-multi DEP_SIGS= SIGNATURE=1056138934 ./subdir2/0040755000076400001440000000000007674664474011661 5ustar gholtusers./subdir2/Makeppfile0100644000076400001440000000016607672712337013647 0ustar gholtusersx.h: echo '#define X 99' > $(output) x2.h: echo '#define X2 100' > $(output) y.h: echo '#define Y 4' > $(output) ./subdir2/.makepp/0040755000076400001440000000000007674663266013212 5ustar gholtusers./subdir2/.makepp/y.h0100644000076400001440000000032207674663266013625 0ustar gholtusersINCLUDES= SORTED_DEPS= SYSTEM_INCLUDES= BUILD_SIGNATURE=1056138934 C_MD5_SUM=97280ad5fa29933d32d94d6c699a2c6b CWD=.. COMMAND=echo '#define Y 4' > y.h ARCH=i586-linux-thread-multi DEP_SIGS= SIGNATURE=1056138934 ./compilation_test_0.c0100644000076400001440000000017507672715333014234 0ustar gholtusers#include #include "x.h" #include "y.h" int main() { printf("%d %d %d %d\n", __LINE__, X, X2, Y); return 0; } ./compilation_test_1.c0100644000076400001440000000025007672715340014225 0ustar gholtusers#include #include "x.h" #include "y.h" /* Same except that a comment was added. */ int main() { printf("%d %d %d %d\n", __LINE__, X, X2, Y); return 0; } ./compilation_test_2.c0100644000076400001440000000025607672715346014242 0ustar gholtusers#include #include "x.h" #include "y.h" /* Line count has changed! Should recompile. */ int main() { printf("%d %d %d %d\n", __LINE__, X, X2, Y); return 0; } ./compilation_test_3.c0100644000076400001440000000043707672715364014244 0ustar gholtusers#include #include "x.h" #include "y.h" /* Only whitespace has changed. No recompilation. */ // This is a C++ comment int main() { printf("%d %d %d %d\n", __LINE__, X, X2, Y); /* another comment that is ignored */ return 0; } ./answers/0040755000076400001440000000000007672715537011764 5ustar gholtusers./answers/n_files0100644000076400001440000000000207672715537013313 0ustar gholtusers0 ./answers/iteration_00100644000076400001440000000001007672715401014076 0ustar gholtusers8 1 2 4 ./answers/iteration_10100644000076400001440000000001007672715404014102 0ustar gholtusers8 1 2 4 ./answers/iteration_20100644000076400001440000000001007672715406014105 0ustar gholtusers9 1 2 4 ./answers/iteration_30100644000076400001440000000001007672715411014102 0ustar gholtusers9 1 2 4 ./answers/n_files_00100644000076400001440000000000207672715401013520 0ustar gholtusers5 ./answers/n_files_10100644000076400001440000000000207672715404013524 0ustar gholtusers0 ./answers/n_files_20100644000076400001440000000000207672715406013527 0ustar gholtusers2 ./answers/n_files_30100644000076400001440000000000207672715411013524 0ustar gholtusers0