-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
82 lines (71 loc) · 2.23 KB
/
Makefile
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
#
# Copyright (C) 2009-2012 Chris McClelland
# Copyright 2015 Joel Stanley <joel@jms.id.au>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# To build the firmware you will need:
# SDCC from http://sdcc.sourceforge.net
# fx2lib from http://fx2lib.wiki.sourceforge.net
#
# To build a firmware suitable for loading into RAM:
# make
#
# To build a firmware suitable for loading from EEPROM:
# make FLAGS="-DEEPROM"
#
#
# This Makefile assumes a recent version of SDCC. If you're still using an older
# version with the asx8051 assembler, build like this:
# make AS8051=asx8051
#
TARGET := hdmi2usb
FX2LIBDIR := ../third_party/fx2lib
COMMON_DIR := ../common
USE_16K := 1
CC_SRCS := app.c cdc.c debug.c softserial.c uvc.c firmware.c read-serialno.c to-uart.c
AS_SRCS := descriptors_hdmi2usb.a51
include $(COMMON_DIR)/common.mk
ifeq ($(USE_16K),1)
CFLAGS += --code-size 0x3e00 -Wl"-b DSCR_AREA=0x2e00" -Wl"-b INT2JT=0x3d00"
else
CFLAGS += --code-size 0x1e00 -Wl"-b DSCR_AREA=0x1e00" -Wl"-b INT2JT=0x1f00"
endif
ifeq (${BOARD},atlys)
VID := 1D50
PID := 60B7
DID := 0002
else
ifeq (${BOARD},opsis)
VID := 2A19
PID := 5442
DID := 0002
else
$(error "Unknown board type '$(BOARD)'")
endif
endif
.PHONY: all clean check check_int2jt
progOffsets.h: prog.rel
$(Q_GEN)cat prog.lst | ./lstParse.py > progOffsets.h
date.inc:
$(Q_GEN)
@echo "; This is an auto-generated file. Please modify the Makefile instead " > $@
@echo DATE=0x$(FIRMWARE_VERSION) > $@
@echo VID=0x$(VID) >> $@
@echo PID=0x$(PID) >> $@
@echo DID=0x$(DID) >> $@
%.rel: %.c
$(Q_CC)$(CC) $(CFLAGS) -c --disable-warning 85 $(INCS) $<
descriptors_hdmi2usb.a51: date.inc
livePatch.c: progOffsets.h