2 # Copyright 2008, 2009 Michel Pollet <buserror@gmail.com>
4 # This file is part of simavr.
6 # simavr is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # simavr is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with simavr. If not, see <http://www.gnu.org/licenses/>.
21 CFLAGS = -g -std=gnu99 -Wall
22 CFLAGS += -O3 -mfpmath=sse -msse2
24 cores = ${wildcard cores/*.c}
25 cores_o = ${patsubst cores/%.c, obj/%.o, ${cores}}
26 sim = ${wildcard sim/*.c}
27 sim_o = ${patsubst sim/%.c, obj/%.o, ${sim}}
37 IPATH += /opt/local/include
39 CFLAGS += ${patsubst %,-I%,${subst :, ,${IPATH}}}
40 LFLAGS = -L/opt/local/lib/
48 obj/sim_%.o : cores/sim_%.h ${wildcard cores/*.h} ${wildcard sim/*.h}
49 obj/sim_%.o : cores/sim_%.c
51 -I/usr/lib/avr/include/ \
61 ${target} : ${cores_o}
63 @gcc $(CFLAGS) $(LFLAGS) \