]> begriffs open source - cmsis-freertos/blob - Demo/lwIP_Demo_Rowley_ARM7/makefile
Updated to FreeRTOS V10.0.1
[cmsis-freertos] / Demo / lwIP_Demo_Rowley_ARM7 / makefile
1 #/*
2 # * FreeRTOS Kernel V10.0.1
3 # * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4 # *
5 # * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 # * this software and associated documentation files (the "Software"), to deal in
7 # * the Software without restriction, including without limitation the rights to
8 # * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 # * the Software, and to permit persons to whom the Software is furnished to do so,
10 # * subject to the following conditions:
11 # *
12 # * The above copyright notice and this permission notice shall be included in all
13 # * copies or substantial portions of the Software.
14 # *
15 # * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 # * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 # * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 # * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 # * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 # *
22 # * http://www.FreeRTOS.org
23 # * http://aws.amazon.com/freertos
24 # *
25 # * 1 tab == 4 spaces!
26 # */
27
28 CC=arm-elf-gcc
29 OBJCOPY=arm-elf-objcopy
30 ARCH=arm-elf-ar
31 CRT0=boot.s
32 DEBUG=-g
33 OPTIM=-O0
34 LDSCRIPT=atmel-rom.ld
35
36 #
37 # CFLAGS common to both the THUMB and ARM mode builds
38 #
39
40 CFLAGS= \
41 -I.  \
42 -I./EMAC  \
43 -I../Common/include  \
44 -I./USB  \
45 -I./lwip-1.1.0/src/include  \
46 -I./lwip-1.1.0/contrib/port/FreeRTOS/AT91SAM7X  \
47 -I../../Source/include  \
48 -I../../Source/portable/GCC/ARM7_AT91SAM7S  \
49 -I./lwip-1.1.0/src/include/ipv4 \
50 -Wall  \
51 -Wextra  \
52 -Wstrict-prototypes  \
53 -Wmissing-prototypes  \
54 -Wmissing-declarations  \
55 -Wno-strict-aliasing  \
56 -D SAM7_GCC  \
57 -D THUMB_INTERWORK \
58 -mthumb-interwork \
59 -mcpu=arm7tdmi  \
60 -T$(LDSCRIPT) \
61 $(DEBUG)  \
62 $(OPTIM) \
63 -fomit-frame-pointer
64
65 THUMB_FLAGS=-mthumb
66 LINKER_FLAGS=-Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
67
68 #
69 # Source files that can be built to THUMB mode.
70 #
71 FREERTOS_THUMB_SRC= \
72   ../../Source/tasks.c \
73   ../../Source/queue.c \
74   ../../Source/list.c \
75   ../../Source/portable/GCC/ARM7_AT91SAM7S/port.c
76
77 DEMO_APP_THMUB_SRC= \
78   ../../Source/portable/MemMang/heap_2.c \
79   ParTest/ParTest.c \
80   main.c \
81   ../Common/Minimal/flash.c \
82   ../Common/Minimal/BlockQ.c \
83   ../Common/Minimal/integer.c \
84   ../Common/Minimal/PollQ.c \
85   ../Common/Minimal/semtest.c \
86   BasicWEB.c \
87   USB/USB-CDC.c 
88
89 LWIP_THUMB_SRC= \
90   lwip-1.1.0/src/core/tcp_out.c \
91   lwip-1.1.0/src/core/inet.c \
92   lwip-1.1.0/src/core/mem.c \
93   lwip-1.1.0/src/core/memp.c \
94   lwip-1.1.0/src/core/netif.c \
95   lwip-1.1.0/src/core/pbuf.c \
96   lwip-1.1.0/src/core/raw.c \
97   lwip-1.1.0/src/core/stats.c \
98   lwip-1.1.0/src/core/sys.c \
99   lwip-1.1.0/src/core/tcp.c \
100   lwip-1.1.0/src/core/tcp_in.c \
101   lwip-1.1.0/src/core/ipv4/ip.c \
102   lwip-1.1.0/src/core/ipv4/ip_addr.c \
103   lwip-1.1.0/src/core/ipv4/icmp.c \
104   lwip-1.1.0/src/api/tcpip.c \
105   lwip-1.1.0/src/api/api_msg.c \
106   lwip-1.1.0/src/api/err.c \
107   lwip-1.1.0/src/api/api_lib.c \
108   lwip-1.1.0/src/netif/etharp.c \
109   lwip-1.1.0/contrib/port/FreeRTOS/AT91SAM7X/sys_arch.c \
110   lwip-1.1.0/src/netif/ethernetif.c \
111   EMAC/SAM7_EMAC.c \
112   lwip-1.1.0/src/core/udp.c \
113   lwip-1.1.0/src/core/ipv4/ip_frag.c
114
115 #
116 # Source files that must be built to ARM mode.
117 #
118 ARM_SRC= \
119   ../../Source/portable/GCC/ARM7_AT91SAM7S/portISR.c \
120   EMAC/SAM7_EMAC_ISR.c \
121   USB/USBIsr.c \
122   Cstartup_SAM7.c  
123
124
125 #
126 # Define all object files.
127 #
128 ARM_OBJ = $(ARM_SRC:.c=.o)
129 FREERTOS_THUMB_OBJ = $(FREERTOS_THUMB_SRC:.c=.o)
130 DEMO_APP_THMUB_OBJ = $(DEMO_APP_THMUB_SRC:.c=.o)
131 LWIP_THUMB_OBJ = $(LWIP_THUMB_SRC:.c=.o)
132
133 rtosdemo.bin : rtosdemo.elf
134         $(OBJCOPY) rtosdemo.elf -O binary rtosdemo.bin
135
136 rtosdemo.hex : rtosdemo.elf
137         $(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex
138
139 rtosdemo.elf : $(ARM_OBJ) $(DEMO_APP_THMUB_OBJ) $(LWIP_THUMB_OBJ) $(FREERTOS_THUMB_OBJ) $(CRT0) Makefile FreeRTOSConfig.h
140         $(CC) $(CFLAGS) $(ARM_OBJ) $(DEMO_APP_THMUB_OBJ) $(LWIP_THUMB_OBJ) $(FREERTOS_THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
141
142 $(DEMO_APP_THMUB_OBJ)  : %.o : %.c $(LDSCRIPT) Makefile FreeRTOSConfig.h
143         $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
144
145 $(LWIP_THUMB_OBJ)  : %.o : %.c $(LDSCRIPT) Makefile FreeRTOSConfig.h
146         $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
147
148 $(FREERTOS_THUMB_OBJ)  : %.o : %.c $(LDSCRIPT) Makefile FreeRTOSConfig.h
149         $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
150
151 $(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile FreeRTOSConfig.h
152         $(CC) -c $(CFLAGS) $< -o $@
153
154 clean :
155         touch Makefile
156