Makefile 2.04 KB
Newer Older
1
EB    ?= no
2
SDBFS ?= ./sdbfs-tools
3

4
CFLAGS = -Wall -ggdb -I../include -I../liblinux -I../liblinux/extest
5
CFLAGS += -D__GIT_VER__="\"$(GIT_VER)\"" -D__GIT_USR__="\"$(GIT_USR)\""
6 7
LDFLAGS = -lutil -L../liblinux -ldevmap -L../liblinux/extest -lextest
LDFLAGS += -lreadline
8
ALL    = genraminit genramvhd genrammif gensdbfs
9
ALL   += wrpc-w1-read wrpc-w1-write
10
ALL   += pfilter-builder
Alessandro Rubini's avatar
Alessandro Rubini committed
11
ALL   += wrpc-dump mapper
12
ALL   += wrpc-vuart
Michel Arruat's avatar
Michel Arruat committed
13 14
ALL   += wr-streamers
ALL   += wrpc-diags
Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
15

16 17 18
ifneq ($(EB),no)
ALL += eb-w1-write
endif
19 20
ifneq ($(SDBFS),no)
ALL += sdb-wrpc.bin
21 22
ALL += sdb-wrpc-flash.bin
ALL += sdb-wrpc-standalone.bin
23
endif
24

25 26 27
AS		= as
LD		= ld
CC		= gcc
Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
28
CPP		= $(CC) -E
29 30 31 32 33
AR		= ar
NM		= nm
STRIP		= strip
OBJCOPY		= objcopy
OBJDUMP		= objdump
Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
34

35
all:	$(ALL)
Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
36

37 38
%:	%.c
	$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
39

40
wrpc-w1-read: wrpc-w1-read.c ../dev/w1.c ../dev/w1-eeprom.c ../dev/w1-hw.c
41 42
	$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

43
wrpc-w1-write: wrpc-w1-write.c ../dev/w1.c ../dev/w1-eeprom.c ../dev/w1-hw.c
44
	$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
45

46
eb-w1-write: eb-w1-write.c ../dev/w1.c ../dev/w1-eeprom.c eb-w1.c
47
	$(CC) $(CFLAGS) -I $(EB) $^ $(LDFLAGS) -o $@ -L $(EB)/.libs -letherbone
48

49 50 51
sdb-wrpc.bin: sdbfs
	$(SDBFS)/gensdbfs $< $@

52 53 54 55 56 57
sdb-wrpc-flash.bin: sdbfs-flash
	$(SDBFS)/gensdbfs -b 65536 $< $@

sdb-wrpc-standalone.bin : sdb-wrpc-flash.bin
	cut -b 3014657- $< > $@

58
wrpc-dump: wrpc-dump.c dump-info-host.o
59
	$(CC) $(CFLAGS) -I../ppsi/include -I../ppsi/arch-wrpc/include -I.. \
60
	-I ../softpll \
61
	$^ -o $@ \
62

Michel Arruat's avatar
Michel Arruat committed
63
wr-streamers: wr-streamers.c
64 65
	$(CC) $(CFLAGS)  $^ $(LDFLAGS) -o $@

Michel Arruat's avatar
Michel Arruat committed
66
wrpc-diags: wrpc-diags.c
67 68
	$(CC) $(CFLAGS)  $^ $(LDFLAGS) -o $@

69 70 71
wrpc-vuart: wrpc-vuart.c
	$(CC) $(CFLAGS) -Werror  $^ $(LDFLAGS) -o $@

72 73 74
pfilter-builder: pfilter-builder.c
	$(CC) $(CFLAGS)  -include ../include/generated/autoconf.h \
		$@.c $(LDFLAGS) -o $@
75 76 77 78 79 80 81 82 83


dump-info-host.o: ../dump-info.o
	$(CROSS_COMPILE)objcopy --only-section=.data.dump_info \
		-O binary $^ dump-info-host.bin
	$(AS) makebin.S -o $@

../dump-info.o: ../dump-info.c
	$(MAKE) -C .. dump-info.o
84 85 86 87

gensdbfs:
	$(MAKE) -C $(SDBFS)

Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
88
clean:
89
	rm -f $(ALL) *.o *~ dump-info-host.bin
90