Files
PowerShell/Makefile
T

112 lines
2.5 KiB
Makefile
Raw Normal View History

2015-10-27 23:42:26 -07:00
# the monad-linux superproject
export MONAD=$(realpath $(CURDIR))
2015-10-27 23:42:26 -07:00
2015-11-24 15:18:24 -08:00
all: powershell-native approot
# managed code
2015-11-24 15:18:24 -08:00
approot:
./publish.sh
# native code
powershell-native: src/monad-native/Makefile
2015-10-26 12:30:22 -07:00
$(MAKE) -j -C src/monad-native
$(MAKE) -j -C src/monad-native test
src/monad-native/Makefile:
2015-11-24 15:18:24 -08:00
cd src/monad-native && cmake .
2015-11-24 15:18:24 -08:00
# installation of pslib
install:
$(MAKE) -C src/monad-native install
ldconfig
# run targets
2015-10-25 20:51:16 -07:00
2015-11-24 15:18:24 -08:00
export POWERSHELL= $(MONAD)/approot/powershell
demo:
2015-11-24 15:18:24 -08:00
$(POWERSHELL) --runspace --command '"a","b","c","a","a" | Select-Object -Unique'
shell:
2015-11-02 16:02:03 -08:00
$(POWERSHELL)
2015-10-25 21:01:15 -07:00
# tests
2015-11-24 15:18:24 -08:00
test: test-xunit
test-xunit:
./test.sh
2015-10-25 21:01:15 -07:00
2015-10-25 20:51:16 -07:00
## TODO: fix this after refactoring bin/powershell
test-hashbang:
2015-11-06 20:28:18 -08:00
PATH=$(PATH):bin src/3rdparty/hashbang/script.ps1
2015-10-25 20:51:16 -07:00
2015-10-25 21:01:15 -07:00
## Pester tests for PowerShell - results in pester-tests.xml
## - see https://github.com/pester/Pester
## - requires $TEMP to be set
## - we cd because some tests rely on the current working directory
PESTER=$(MONAD)/src/pester-tests
test-pester:
2015-11-02 16:02:03 -08:00
$(POWERSHELL) 'invoke-pester $(PESTER) -OutputFile $(MONAD)/pester-tests.xml -OutputFormat NUnitXml'
2015-10-25 21:01:15 -07:00
## Pester self-tests
## - results in pester-self-tests.xml
test-pester-self:
2015-11-02 16:02:03 -08:00
$(POWERSHELL) 'cd $(PSLIB)/Modules/Pester/Functions; $$env:TEMP="/tmp"; invoke-pester -OutputFile $(MONAD)/pester-self-tests.xml -OutputFormat NUnitXml'
2015-10-25 21:01:15 -07:00
2015-10-25 22:19:35 -07:00
## tracing
## - use PAL_DBG_CHANNELS="+LOADER.TRACE" to enable CoreCLR tracing
## - use Set-PSDebug -Trace 2 to enable PowerShell tracing
2015-10-25 22:17:52 -07:00
# OMI
OMI=src/omi/Unix
OMI_FLAGS=--dev --enable-debug
$(OMI)/GNUmakefile:
cd $(OMI) && ./configure $(OMI_FLAGS)
OMISERVER=$(OMI)/output/bin/omiserver
$(OMISERVER): $(OMI)/GNUmakefile
$(MAKE) -j -C $(OMI)
## copy libpshost because OMI isn't configurable
MONAD_PROVIDER=src/monad-omi-provider
2015-10-26 12:09:53 -07:00
PSRP_OMI_PROVIDER=$(OMI)/output/lib/libpsrpomiprov.so
$(PSRP_OMI_PROVIDER): $(OMISERVER) powershell-native
2015-10-25 22:17:52 -07:00
cp lib/libpshost.a $(OMI)/output/lib
$(MAKE) -j -C $(MONAD_PROVIDER)
psrp: $(PSRP_OMI_PROVIDER)
## phony targets so that the recursive make is always invoked
.PHONY: $(OMISERVER) $(PSRP_OMI_PROVIDER)
2015-10-25 20:51:16 -07:00
# clean targets
2015-10-25 22:31:31 -07:00
clean: clean-monad
2015-10-26 12:09:47 -07:00
-rm *-tests.xml
2015-10-25 22:19:23 -07:00
2015-10-26 12:38:34 -07:00
distclean: distclean-monad distclean-native distclean-omi clean
2015-10-28 10:04:39 -07:00
-rm -rf $(CLRLIB)
2015-10-25 22:19:23 -07:00
clean-monad:
2015-11-24 15:18:24 -08:00
rm -rf approot
2015-10-25 22:19:23 -07:00
distclean-monad:
2015-11-24 15:18:24 -08:00
./nuke.sh
2015-10-25 22:19:23 -07:00
clean-native:
-$(MAKE) -C src/monad-native clean
2015-10-26 12:38:34 -07:00
distclean-native:
cd src/monad-native && git clean -fdx
2015-10-25 22:19:23 -07:00
clean-omi:
-$(MAKE) -C $(OMI) clean
distclean-omi:
-$(MAKE) -C $(OMI) distclean
clean-psrp:
-$(MAKE) -C $(MONAD_PROVIDER) clean