1# 2# 3# Makefile for building userland tests 4# this is written in a form compatible with gmake 5 6SCHED_SRCS = test_dn_sched.c 7SCHED_SRCS += dn_sched_fifo.c 8SCHED_SRCS += dn_sched_prio.c 9SCHED_SRCS += dn_sched_qfq.c 10SCHED_SRCS += dn_sched_rr.c 11SCHED_SRCS += dn_sched_wf2q.c 12SCHED_SRCS += dn_heap.c 13SCHED_SRCS += main.c 14 15SCHED_OBJS=$(SCHED_SRCS:.c=.o) 16 17HEAP_SRCS = dn_heap.c test_dn_heap.c 18HEAP_OBJS=$(HEAP_SRCS:.c=.o) 19 20VPATH= .:.. 21 22CFLAGS = -I.. -I. -Wall -Werror -O3 -Wextra 23TARGETS= test_sched # no test_heap by default 24 25all: $(TARGETS) 26 27test_heap : $(HEAP_OBJS) 28 $(CC) -o $@ $(HEAP_OBJS) 29 30test_sched : $(SCHED_OBJS) 31 $(CC) -o $@ $(SCHED_OBJS) 32 33$(SCHED_OBJS): dn_test.h 34main.o: mylist.h 35 36clean: 37 - rm *.o $(TARGETS) *.core 38 39ALLSRCS = $(SCHED_SRCS) dn_test.h mylist.h \ 40 dn_sched.h dn_heap.h ip_dn_private.h Makefile 41TMPBASE = /tmp/testXYZ 42TMPDIR = $(TMPBASE)/test 43 44tgz: 45 -rm -rf $(TMPDIR) 46 mkdir -p $(TMPDIR) 47 -cp -p $(ALLSRCS) $(TMPDIR) 48 -(cd ..; cp -p $(ALLSRCS) $(TMPDIR)) 49 ls -la $(TMPDIR) 50 (cd $(TMPBASE); tar cvzf /tmp/test.tgz test) 51