OpenCores
URL https://opencores.org/ocsvn/gecko3/gecko3/trunk

Subversion Repositories gecko3

[/] [gecko3/] [trunk/] [GECKO3COM/] [gecko3com-fw/] [firmware/] [src/] [Makefile] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 nussgipfel
# GECKO3COM
2
#
3
# Copyright (C) 2008 by
4
#   ___    ____  _   _
5
#  (  _`\ (  __)( ) ( )
6
#  | (_) )| (_  | |_| |   Berne University of Applied Sciences
7
#  |  _ <'|  _) |  _  |   School of Engineering and
8
#  | (_) )| |   | | | |   Information Technology
9
#  (____/'(_)   (_) (_)
10
#
11
#
12
# This program is free software: you can redistribute it and/or modify
13
# it under the terms of the GNU General Public License as published by
14
# the Free Software Foundation, either version 3 of the License, or
15
# (at your option) any later version.
16
#
17
# This program is distributed in the hope that it will be useful,
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
# GNU General Public License for more details.
21
# You should have received a copy of the GNU General Public License
22
# along with this program.  If not, see .
23
#
24
 
25
PACKAGE = gecko3com.hex
26
 
27
BOARD = GECKO3MAIN #currently the only supported board
28
 
29 33 nussgipfel
#DEBUG = --debug -DDEBUG_LEVEL_INFO
30
DEBUG =
31 9 nussgipfel
 
32
MEMOPTS = --code-loc 0x0000 --code-size 0x3A00 --xram-loc 0x3A00 --xram-size 0x0600 -Wl '-b USBDESCSEG = 0xE000'
33
 
34
ASFLAGS = -plosgff
35
 
36
CFLAGS = --opt-code-size --no-xinit-opt -mmcs51 --model-small $(MEMOPTS) $(DEBUG) -D$(BOARD)
37
 
38
LDFLAGS = --model-small $(MEMOPTS) $(DEBUG)
39
 
40
INCLUDE_DIR = ../include
41
LIB_DIR = ../lib
42
LIB = libfx2
43
GPIF_DIR = ../gpif-design
44
GPIF_DATA = gpif_data
45
BUILD_DIR = build
46
CC = sdcc
47
 
48
# the Hex2bix utility is included in the development software package
49
# provided by Cypress. you can download it for free.
50
# feel free to enhance the hex2bix.py python script from the GNUradio project
51
# to replace this wine & proprietary software hack.
52
HEX2BIX = wine Hex2bix.exe -I -F 0xC2 -C 0×41 -R -M 0xe200 -V 0×0547 -P 0×0002
53
 
54
SRCS_C =  eeprom_io.c           \
55
          usb_tmc.c             \
56
          scpi_parser.c         \
57
          fpga_load.c           \
58
          spi_flash.c           \
59
          $(GPIF_DATA).c        \
60
          gecko3com_gpif.c      \
61
          gecko3com_common.c    \
62
          gecko3com_main.c
63
 
64
SRCS_ASM = \
65
        vectors.a51             \
66
        _startup.a51            \
67
        usb_descriptors.a51
68
 
69
#SRCS_RE = \
70
#       scpi_parser.re
71
 
72
 
73
 
74
OBJS = $(SRCS_ASM:.a51=.rel) $(SRCS_C:.c=.rel) #$(SRCS_RE:.re=.rel)
75
 
76
all : $(LIB) $(GPIF_DIR) $(BUILD_DIR) $(PACKAGE)
77
 
78
iic : $(LIB) $(GPIF_DIR) $(BUILD_DIR) $(PACKAGE) $(PACKAGE:.hex=.iic)
79
 
80
 
81
$(BUILD_DIR) :
82
        mkdir $@
83
 
84
$(BUILD_DIR)/%.rel : %.c
85
        $(CC) -c $(CFLAGS) -I$(INCLUDE_DIR) -o $@ $<
86
 
87
$(BUILD_DIR)/%.rel : %.a51
88
        cp $< $(BUILD_DIR)/
89
        cd $(BUILD_DIR)
90
        asx8051 $(ASFLAGS) $(BUILD_DIR)/$<
91
 
92
$(LIB) :
93
        cd $(LIB_DIR) && $(MAKE)
94
 
95
 
96
$(GPIF_DATA).c :
97
        $(MAKE) -C $(GPIF_DIR) $(BOARD) /
98
        cp $(GPIF_DIR)/gpif_data.* .
99
 
100
 
101
ls $(PACKAGE) : $(patsubst %,$(BUILD_DIR)/%,$(OBJS))
102
        $(CC) $(LDFLAGS) -o $@ -L$(LIB_DIR) -l $(LIB) $^
103
 
104
%.hex : %.ihx
105
        cp $< $@
106
 
107
%.iic : %.hex
108
        $(HEX2BIX) -o $@ $<
109 15 nussgipfel
        cp $@ ../../
110 9 nussgipfel
 
111
%.c   : %.re
112
        re2c -s -o $@ $<
113
 
114
clean :
115
        rm -f $(PACKAGE) $(BUILD_DIR)/* *.iic *.mem *.cdb *.map *.lnk gpif_data.*
116
        cd $(LIB_DIR) && $(MAKE) clean
117
        cd $(GPIF_DIR) && $(MAKE) clean
118
 
119
 
120
.PHONY : clean all
121
 
122
 
123
 
124
 
125
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.