-
-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefile: Clean up cmake invocations
Use cmake command to build and install instead of invoking make. Also use -G option consistently. This allows to use other generators like Ninja: make GENERATOR=Ninja Use cmake -B option instead of switching directories.
- Loading branch information
Showing
4 changed files
with
70 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
* text=auto eol=lf | ||
Makefile.nmake eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,29 @@ | ||
SRCDIR=src | ||
DATADIR=data | ||
BUILDDIR=build | ||
INSTALLDIR=windows | ||
SPEC=test/spec.txt | ||
PROG=$(BUILDDIR)\src\cmark.exe | ||
GENERATOR=NMake Makefiles | ||
|
||
all: $(BUILDDIR)/CMakeFiles | ||
@cd $(BUILDDIR) && $(MAKE) /nologo && cd .. | ||
|
||
$(BUILDDIR)/CMakeFiles: | ||
@-mkdir $(BUILDDIR) 2> nul | ||
cd $(BUILDDIR) && \ | ||
cmake \ | ||
-G "$(GENERATOR)" \ | ||
-D CMAKE_BUILD_TYPE=$(BUILD_TYPE) \ | ||
-D CMAKE_INSTALL_PREFIX=$(INSTALLDIR) \ | ||
.. && \ | ||
cd .. | ||
|
||
install: all | ||
@cd $(BUILDDIR) && $(MAKE) /nologo install && cd .. | ||
|
||
clean: | ||
-rmdir /s /q $(BUILDDIR) $(MINGW_INSTALLDIR) 2> nul | ||
|
||
test: $(SPEC) all | ||
@cd $(BUILDDIR) && $(MAKE) /nologo test ARGS="-V" && cd .. | ||
|
||
distclean: clean | ||
del /q src\scanners.c 2> nul | ||
del /q spec.md spec.html 2> nul | ||
SRCDIR=src | ||
DATADIR=data | ||
BUILDDIR=build | ||
INSTALLDIR=windows | ||
SPEC=test/spec.txt | ||
PROG=$(BUILDDIR)\src\cmark.exe | ||
GENERATOR=NMake Makefiles | ||
|
||
all: $(BUILDDIR)/CMakeFiles | ||
cmake --build $(BUILDDIR) | ||
|
||
$(BUILDDIR)/CMakeFiles: | ||
cmake \ | ||
-S . -B $(BUILDDIR) -G "$(GENERATOR)" \ | ||
-D CMAKE_BUILD_TYPE=$(BUILD_TYPE) \ | ||
-D CMAKE_INSTALL_PREFIX=$(INSTALLDIR) | ||
|
||
install: all | ||
cmake --install $(BUILDDIR) | ||
|
||
clean: | ||
-rmdir /s /q $(BUILDDIR) $(MINGW_INSTALLDIR) 2> nul | ||
|
||
test: $(SPEC) all | ||
ctest --test-dir $(BUILDDIR) --output-on-failure | ||
|
||
distclean: clean | ||
del /q src\scanners.c 2> nul | ||
del /q spec.md spec.html 2> nul |