File: Makefile

package info (click to toggle)
rtlinux 3.1pre3-3
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 4,896 kB
  • ctags: 4,228
  • sloc: ansic: 26,204; sh: 2,069; makefile: 1,414; perl: 855; tcl: 489; asm: 380; cpp: 42
file content (93 lines) | stat: -rw-r--r-- 2,404 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
CC        = $(CROSS_COMPILE)gcc
CPP       = $(CROSS_COMPILE)gcc -E

LDFLAGS   = 

include ../../rtl.mk
CFLAGS += -I.


# Remove -DSHM_DEMO for real use. 
# Remove -D__RT__ for non real time Linux

# -DMBUFF_LIB_ONLY disables registration of its own misc char device by mbuff.o
# this is for use as shm library only for RT-FIFOs

.SUFFIXES: .o .c .h .m .i .S


OBJS = mmap.o kvmem.o mbuff_proc.o

all: module
#	@echo $(LINUXDIR) assumed to be your kernel source directory.
	@echo "do 'make tests' to build all mbuff demo programs."

tests: tester mbuff mbuff_alloc mbuff_dealloc demo

module: mbuff.o #rtl_nfifo.o

mbuff: 
	-mknod ./mbuff c 10 254

mbuff.o: $(OBJS)
	$(CROSS_COMPILE)ld -r $(OBJS) -o mbuff.o
	cp -f mbuff.o $(RTL_DIR)/modules

clean:
	-rm -f $(OBJS) *.o tester core mbuff_alloc mbuff_dealloc mbuff demo

#.m.o:
#	$(CC) $(INCLUDES) -c $(INCDIRS) $(CFLAGS) $(X_CFLAGS) $(DEBUGFLAGS) $*.m
#.c.o:
#	$(CC) $(INCLUDES) -c $(INCDIRS) $(CFLAGS) $(X_CFLAGS) $(DEBUGFLAGS) $*.c -o $@
#.c.s:
#	$(CC) $(INCLUDES) -S $(INCDIRS) $(CFLAGS) $(X_CFLAGS) $(DEBUGFLAGS) $*.c -o $@
#.c.i:
#	$(CC) $(INCLUDES) -E $(INCDIRS) $(CFLAGS) $(X_CFLAGS) $(DEBUGFLAGS) $*.c > $@
#.S.o:
#	$(CC) $(INCLUDES) -c $(INCDIRS) $(CFLAGS) $(X_CFLAGS) $(DEBUGFLAGS) $*.S -o $@
#.s.o:
#	$(CC) $(INCLUDES) -c $(INCDIRS) $(CFLAGS) $(X_CFLAGS) $(DEBUGFLAGS) $*.s -o $@

tester: tester.c mbuff.h
	gcc -g -O2 -DSHM_DEMO -o tester tester.c
mbuff_alloc: mbuff_alloc.c mbuff.h
	gcc -g -O2 -DSHM_DEMO -o mbuff_alloc mbuff_alloc.c
mbuff_dealloc: mbuff_dealloc.c mbuff.h
	gcc -g -O2 -DSHM_DEMO -o mbuff_dealloc mbuff_dealloc.c
demo: demo.c mbuff.h
	gcc -g -O2 -DSHM_DEMO -o demo demo.c

test: test1 test2
test1: tests all
	-rmmod mbuff
	-insmod -f mbuff.o 
	./mbuff_alloc default 409600
# RT-FIFO-000 is the default area when /dev/rtf0 is open
	-./tester

test2: tests all
	-rmmod mbuff
	-insmod -f mbuff.o
	(./tester &); sleep 2; (./tester &); ./mbuff_dealloc default

test1nfifo: tests all
	-rmmod rtl_nfifo
	-rmmod mbuff
	-rmmod rtl_posixio
	-insmod mbuff.o 
	-modprobe rtl_posixio
	-insmod rtl_nfifo.o
	./mbuff_alloc RT-FIFO-000 409600
# RT-FIFO-000 is the default area when /dev/rtf0 is open
	-./tester

test2nfifo: tests all
	-rmmod rtl_nfifo
	-rmmod mbuff
	-rmmod rtl_posixio
	-insmod mbuff.o
	-modprobe rtl_posixio
	-insmod rtl_nfifo.o; (./tester &); sleep 2; (./tester &); ./mbuff_dealloc RT-FIFO-000

include $(RTL_DIR)/Rules.make