# this is a sample makefile for making userspace test
# Copyright (C) 2024, guoct1@chinatelecom.cn.

libdir=../../lib
libsrc=$(wildcard $(libdir)/*/*.c)
cflags=-Wall -g -Wl,--as-needed

.phony: run debug clean

test: test.c $(libsrc)
	gcc $(cflags) -o $@ $^ -I$(libdir)

run: test
	./test

debug: test
	gdb ./test

clean:
	rm test
