BASEDIR=../..

include $(BASEDIR)/Makefile-rules

###############################################################################

KERNEL_LIBS = $(TOPDIR)/elks/arch/i86/lib/lib86.a

###############################################################################

PRGS = \
    test_audio \
    test_exit \
    test_eth \
    test_float \
    test_ktcp \
    test_pty \
    test_select \
    test_signal \
    test_sigfail \
    # EOL

ifndef CONFIG_ARCH_SOLO86
PRGS += test_fd
endif

all: $(PRGS)

test_audio: test_audio.o
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

test_exit: test_exit.o
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

test_eth: test_eth.o
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

test_fd: test_fd.o $(TINYPRINTF)
	$(LD) $(LDFLAGS) -o $@ test_fd.o $(TINYPRINTF) $(KERNEL_LIBS) $(LDLIBS)

test_float: test_float.o
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

test_ktcp: test_ktcp.o
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

test_pty: test_pty.o
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

test_select: test_select.o
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

test_signal: test_signal.o
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

test_sigfail: test_sigfail.o
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

install: $(PRGS)
	$(INSTALL) $(PRGS) $(DESTDIR)/bin

clean:
	$(RM) $(PRGS) *.o
