-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile-cross
51 lines (33 loc) · 1.07 KB
/
Makefile-cross
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
# Makefile for cross-compiling the fbtest program
#
# Export an OETMP environment variable that points to the
# same location as TMPDIR in build/conf/local.conf
#
### cross-build defs ###
ifeq ($(strip $(OETMP)),)
# make things fail if OETMP not defined by pointing OETMP
# at an invalid location
OETMP=/tmp
endif
TOOLDIR = $(OETMP)/sysroots/`uname -m`-linux/usr/bin
STAGEDIR = ${OETMP}/sysroots/overo/usr
# soft-floating point
#CC = ${TOOLDIR}/armv7a-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
# hard-floating point
CC = ${TOOLDIR}/cortexa8hf-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
CFLAGS = -O2 -Wall
LIBDIR = $(STAGEDIR)/lib
INCDIR = $(STAGEDIR)/include
### end cross-build defs ###
OBJS = main.o
TARGET = fbtest
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -L $(LIBDIR) $(OBJS) -o $(TARGET)
%.o: %.c
$(CC) $(CFLAGS) -I $(INCDIR) -c -o $@ $<
# purely for my convenience ;-)
install: $(TARGET)
scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $(TARGET) root@192.168.10.111:/home/root
.PHONY: clean
clean:
rm -f $(OBJS) $(TARGET)