Will `make clean` clean the dependencies?

jronald

Active Member

Reaction score: 9
Messages: 176

Will `make clean` clean the dependencies, which is not dependent by others?

Just now I tried to install gnome2-lite using port:
firstly I run `make`, error occurs,
I ignored the error and run `make install`, it seems working - downloading, compiling, linking, but after several hours, error occurs, I don't know how to fix it
(need an automatic way :) ), so I want to rollback it, does `make clean` help here?
BTW, I found disk usage grows when `make clean` is done.
Thanks in advance.
 

fronclynne

Daemon

Reaction score: 175
Messages: 1,296

# make clean should catch the dependencies, however the simplest and most straight-forward way of removing the build directories is # rm -r /usr/ports/*/*/work (or, if you have [red]WRKDIRPREFIX=[/red] set, the relative equivalent under that).

If old or mis-set options are causing trouble, # make rmconfig in the relevant port directory, or (assuming that's not catching what you want) you can remove directories under /var/db/ports/.
 

sixtydoses

Well-Known Member

Reaction score: 59
Messages: 400

jronald said:
Will `make clean` clean the dependencies, which is not dependent by others?

Just now I tried to install gnome2-lite using port:
firstly I run `make`, error occurs,
I ignored the error and run `make install`, it seems working - downloading, compiling, linking, but after several hours, error occurs, I don't know how to fix it
(need an automatic way :) ), so I want to rollback it, does `make clean` help here?
BTW, I found disk usage grows when `make clean` is done.
Thanks in advance.
I think what you're looking for is # make clean-depends. # make clean, as fronclynne mentioned earlier, is similar to # rm -r /usr/ports/*/*/work.


Code:
# clean                 - Remove ${WRKDIR} and other temporary files used for building.
# clean-depends - Do a "make clean" for all dependencies.

You could refer for more make options in /usr/ports/Mk/bsd.port.mk.
 

phoenix

Administrator
Staff member
Administrator
Moderator

Reaction score: 1,258
Messages: 4,098

fronclynne said:
# make clean should catch the dependencies,
No, it won't. make clean only cleans the work directory for the current port.
# make clean-recursive will clean out the work directory for the current port, and the work directories for all dependencies of the current port.

# rm -rf /usr/ports/*/*/work will clear out all the work directories for all ports. As will using # portsclean -CDD, which is part of the portupgrade suite of tools.
 

gcooper@

Member
Developer

Reaction score: 14
Messages: 71

phoenix said:
No, it won't. make clean only cleans the work directory for the current port.
# make clean-recursive will clean out the work directory for the current port, and the work directories for all dependencies of the current port.

# rm -rf /usr/ports/*/*/work will clear out all the work directories for all ports. As will using # portsclean -CDD, which is part of the portupgrade suite of tools.
find /usr/ports -name work -mindepth 2 -maxdepth 3 | xargs rm -Rf

would be a safer bet -- especially because the globbing could go over the shell argument character limit.
 

l2f

Member

Reaction score: 4
Messages: 61

More safer: -type d = directory

Code:
find /usr/ports -type d -name work -mindepth 2 -maxdepth 3 | xargs rm -Rf
 
Top