Skip to content

Commit

Permalink
winbuild: make the clean target work without build-type
Browse files Browse the repository at this point in the history
Due to the check in Makefile.vc and MakefileBuild.vc, no make call can
be invoked unless a build-type was specified. However, a clean target
only existed when a build type was specified. As a result, the clean
target was unreachable. Made clean target unconditional.

Closes #2455
  • Loading branch information
kdekker authored and bagder committed Apr 6, 2018
1 parent a65a75e commit 8585026
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions winbuild/Makefile.vc
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,6 @@ $(MODE):
copy_from_lib:
echo copying .c...
FOR %%i IN ($(CURLX_CFILES:/=\)) DO copy %%i ..\src\

clean:
$(MAKE) /NOLOGO /F MakefileBuild.vc $@
26 changes: 15 additions & 11 deletions winbuild/MakefileBuild.vc
Original file line number Diff line number Diff line change
Expand Up @@ -426,17 +426,7 @@ CURL_LINK = link.exe /incremental:no /libpath:"$(DIRDIST)\lib"
#######################
# Only the clean target can be used if a config was not provided.
#
!IF "$(CFGSET)" == "FALSE"
clean:
@-erase /s *.dll 2> NUL
@-erase /s *.exp 2> NUL
@-erase /s *.idb 2> NUL
@-erase /s *.lib 2> NUL
@-erase /s *.obj 2> NUL
@-erase /s *.pch 2> NUL
@-erase /s *.pdb 2> NUL
@-erase /s *.res 2> NUL
!ELSE
!IF "$(CFGSET)" != "FALSE"
# A mode was provided, so the library can be built.
#
!include CURL_OBJS.inc
Expand Down Expand Up @@ -563,3 +553,17 @@ $(CURL_DIROBJ)\curl.res: $(CURL_SRC_DIR)\curl.rc
rc $(CURL_RC_FLAGS)

!ENDIF # End of case where a config was provided.

clean:
@-erase /s *.dll 2> NUL
@-erase /s *.exp 2> NUL
@-erase /s *.idb 2> NUL
@-erase /s *.lib 2> NUL
@-erase /s *.obj 2> NUL
@-erase /s *.pch 2> NUL
@-erase /s *.pdb 2> NUL
@-erase /s *.res 2> NUL
@if exist $(LIB_DIROBJ) rd /s/q $(LIB_DIROBJ)
@if exist $(CURL_DIROBJ)rd /s/q $(CURL_DIROBJ)
@if exist $(DIRDIST) rd /s/q $(DIRDIST)

0 comments on commit 8585026

Please sign in to comment.