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