CFLAGS = $(shell rtai-config --lxrt-cflags)
LDFLAGS = $(shell rtai-config --lxrt-ldflags) -lpthread -llxrt -lm

CFLAGS += -D__IN_RTAI__ -Wall -O2 -I.

OBJS = msg_many.o msg_helper.o

all: msg_many

msg_many: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS)

$(OBJS): msg_many.h

run: msg_many
	rtai-load msg_many --verbose

.PHONY: clean
clean:
	rm -f msg_many $(OBJS)