-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile.firmware
66 lines (54 loc) · 2.55 KB
/
Makefile.firmware
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
FW_INC=-I$(FW_DIR) -I$(LIB_DIR)
FW_TEST_SRC=$(wildcard $(FW_DIR)/*_ut.c)
FW_CORE := firmware/crc.c
FW_CORE += firmware/CommandIO.c
FW_CORE += firmware/error.c
FW_CORE += firmware/ledstrip.c
FW_CORE += firmware/main_common.c
FW_CORE += firmware/RingBuf.c
FW_CORE += firmware/rtc_linux.c
FW_CORE += firmware/ScriptCtrl.c
FW_CORE += firmware/timer_thread.c
FW_CORE += firmware/trace.c
FW_CORE += firmware/usart_socket.c
FW_CORE += firmware/Version.c
${BINDIR}/CommandIO_ut.bin: ${OBJDIR}/CommandIO_ut.o ${OBJDIR}/CommandIO.o
${BINDIR}/crc_ut.bin: ${OBJDIR}/crc_ut.o ${OBJDIR}/crc.o
${BINDIR}/eeprom_file_ut.bin: ${OBJDIR}/eeprom_file_ut.o ${OBJDIR}/eeprom_file.o
${BINDIR}/ledstrip_ut.bin: ${OBJDIR}/ledstrip_ut.o ${OBJDIR}/ledstrip.o
${BINDIR}/RingBuf_ut.bin: ${OBJDIR}/RingBuf_ut.o ${OBJDIR}/RingBuf.o
${BINDIR}/ScriptCtrl_ut.bin: ${OBJDIR}/ScriptCtrl_ut.o ${OBJDIR}/ScriptCtrl.o ${OBJDIR}/eeprom_ram.o
PIC_FLAGS := -CC -fINHX32 -p18F26K22 -a -L -Q -V -FM
# CPPFLAGS is broken by makedef
GCC_FLAGS += -std=c++11
GCC_FLAGS += -lpthread
GCC_FLAGS += -DDEBUG
GCC_FLAGS += -DX86
GCC_FLAGS += -pedantic
GCC_FLAGS += -Wall
firmware_pic:
${WINE} ${PIC_CC8E} $(FW_INC) $(FW_DIR)/main_pic.c ${PIC_FLAGS} -O${BINDIR}
firmware_pic_release:
${WINE} ${PIC_CC8E} $(FW_INC) $(FW_DIR)/main_pic.c -ver#VersionFile.h ${PIC_FLAGS} -O${BINDIR}
OPENWRT_SDK = $(shell pwd)/tools/OpenWrt-SDK-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/
$(OPENWRT_SDK):
wget http://download.labs.mediatek.com/MediaTek_LinkIt_Smart_7688_Openwrt_sdk_Linux -O - | tar xj -C tools/
firmware_linkit: CROSS_COMPILE = $(OPENWRT_SDK)/mipsel-openwrt-linux-uclibc-
firmware_linkit: export STAGING_DIR = $(OPENWRT_SDK)/../
firmware_linkit: | $(OPENWRT_SDK)
firmware_linkit: firmware/eeprom_ram.c
firmware_linkit: firmware/spi_pwmdev.cpp
firmware_linkit: $(FW_CORE)
$(CROSS_COMPILE)$(CXX) $? $(GCC_FLAGS) -o ${BINDIR}/linkit.bin
firmware_raspi: firmware/eeprom_ram.c
firmware_raspi: firmware/spi_spidev.c
firmware_raspi: $(FW_CORE)
$(CXX) $? $(GCC_FLAGS) -o ${BINDIR}/raspi.bin
#firmware_simu: firmware/eeprom_file.cpp
firmware_simu: firmware/eeprom_ram.c
firmware_simu: firmware/spi_opengl.c
firmware_simu: $(FW_CORE)
$(CXX) $(FW_INC) $? $(GCC_FLAGS) ${OPENGL_LIB} -o ${BINDIR}/simu.bin
firmware_test: ${OBJDIR} ${BINDIR} firmware_standart_test
firmware_standart_test: ${BINDIR}/CommandIO_ut.bin ${BINDIR}/crc_ut.bin ${BINDIR}/eeprom_file_ut.bin ${BINDIR}/ledstrip_ut.bin ${BINDIR}/RingBuf_ut.bin ${BINDIR}/ScriptCtrl_ut.bin
@$(foreach test,$^,./$(test);)