include $(ROOT)/mk/grabsrc.mk
include ../Makefile.inc

.PHONY: all clean

TARGET := diagdummy

LDFLAGS += -L$(ROOT)/ulib -l:libulib.a

SRCFILES := $(call GRABSRC, .)
CFILES := $(call GET_CFILES, $(SRCFILES))
OBJ := $(call GET_OBJ, $(SRCFILES))

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

all: $(TARGET)

$(TARGET): $(OBJ)
	$(LD) $^ $(LDFLAGS) -o $@
	echo $$(realpath $(TARGET)) >> $(FILES)

clean:
	rm -f $(OBJ) $(TARGET)
