sheepy

build system (sheepy) and package manager (spm) for C
git clone https://spartatek.se/git/sheepy.git
Log | Files | Refs | README | LICENSE

commit 631f2c12000fee47b68e2b477d18eef0a593af04
parent e4e657f976e8812a389b6f46d4778dba133b84b1
Author: Remy Noulin <loader2x@gmail.com>
Date:   Thu, 11 Jun 2020 21:24:13 +0200

fix bug preventing cleaning of object files when running sheepy -d in a package

src/sheepy.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)

Diffstat:
Msrc/sheepy.c | 19+++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/sheepy.c b/src/sheepy.c @@ -1248,7 +1248,8 @@ int MAIN(int ARGC, char** ARGV) { pError(stat(buildCPath, &ost)) //logVarG(cst.st_mtime); //logVarG(ost.st_mtime); - if (cst.st_mtime != ost.st_mtime) { + if (cst.st_mtime != ost.st_mtime or sheepyParams.clean) { + // when cleaning, add all C files //logP("DIFFERENT DATES RECOMPILE"); addFileToCompile(actualDir, k, buildCPath, toCompile); // copy header dates to not recompile unecesserarily next time @@ -1341,7 +1342,8 @@ int MAIN(int ARGC, char** ARGV) { // compare to header modification time in build path struct stat bst; pError(stat(dum, &bst)) - if (hst.st_mtime != bst.st_mtime) { + if (hst.st_mtime != bst.st_mtime or sheepyParams.clean) { + // clean all files // header is updated //logP("H UPDATED"); addCFileK = yes; @@ -1505,7 +1507,8 @@ int MAIN(int ARGC, char** ARGV) { struct stat ost; pError(stat(oPath, &ost)) - if (cst.st_mtime != ost.st_mtime) { + if (cst.st_mtime != ost.st_mtime or sheepyParams.clean) { + // clean all files //puts("DIFFERENT DATES RECOMPILE"); addFileToCompile(actualDir, ssGet(L), oPath, toCompile); } @@ -1992,8 +1995,16 @@ int MAIN(int ARGC, char** ARGV) { forEachSmallArray(incList, incL) { castS(L, incL) + char *l = ssGet(L); + if (startsWithG(l, buildPath)) { + // skip buildPath when looking for PACKAGE_DIR in L + // because the user can be cleaning a package + // without this the object files are not deleted + l += strlen(buildPath); + } + // L is in the format: shpPackages/NAME/NAME.a - if (hasG(L, PACKAGE_DIR)) { + if (hasG(l, PACKAGE_DIR)) { // the packages are already compiled // keep .a files finishG(L);