Packages

Sleeps shorter than a millisecond for the BEAM: a small C program, run as a port, that answers after the nanoseconds asked for.

Current section

Files

Jump to
nanosleep Makefile.win
Raw

Makefile.win

# Builds the port program with MSVC's nmake and cl, which elixir_make uses on Windows,
# into the application's priv directory.

PREFIX = $(MIX_APP_PATH)\priv

all: $(PREFIX)\nanosleep.exe

$(PREFIX)\nanosleep.exe: c_src\nanosleep.c Makefile.win
	if not exist "$(PREFIX)" mkdir "$(PREFIX)"
	cl /nologo /O2 /W3 /std:c11 /Fe"$(PREFIX)\nanosleep.exe" /Fo"$(PREFIX)\nanosleep.obj" c_src\nanosleep.c
	del "$(PREFIX)\nanosleep.obj"

clean:
	if exist "$(PREFIX)\nanosleep.exe" del "$(PREFIX)\nanosleep.exe"