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
Raw

Makefile

# Builds the port program into the application's priv directory. elixir_make runs this
# when the dependency compiles, with MIX_APP_PATH set to where the application is built.

PREFIX = $(MIX_APP_PATH)/priv
CFLAGS ?= -O2
CFLAGS += -Wall -Wextra -std=gnu11

all: $(PREFIX)/nanosleep

$(PREFIX)/nanosleep: c_src/nanosleep.c Makefile
	@mkdir -p $(PREFIX)
	$(CC) $(CFLAGS) -o $@ c_src/nanosleep.c $(LDFLAGS)

clean:
	$(RM) $(PREFIX)/nanosleep

.PHONY: all clean