Skip to content

Instantly share code, notes, and snippets.

@quinnjr
Created January 25, 2020 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quinnjr/644f654f3318f76c66e1c4644ee10f7c to your computer and use it in GitHub Desktop.
Save quinnjr/644f654f3318f76c66e1c4644ee10f7c to your computer and use it in GitHub Desktop.
A generic, not-perfect F# compilation Makefile
# Copyright (C) Joseph R. Quinn 2020
# SPDX-License-Identifier: ISC
ifeq ($(OS),"Windows_NT")
FSC := $(shell where fsc)
else
FSC := $(shell which fsharpc)
endif
input := $(shell find . -type f -name "*.fs")
output := $(input:.fs=)
.PHONY: build clean
build: $(output)
$(output): $(input)
$(FSC) --nologo --target:exe --out:$@ $(@:%=%.fs)
clean:
$(foreach executable, $(input:%.fs=%), $(RM) $(executable))
$(foreach dll, $(shell find . -type f -name "FSharp.Core.dll"), $(RM) $(dll))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment