# You should have received a copy of the GNU General Public License
# along with simavr. If not, see <http://www.gnu.org/licenses/>.
-
-SHELL = /bin/bash
-
sources := $(wildcard at*.c)
simavr = ..
IPATH += ${simavr}/include
IPATH += ${simavr}/simavr/sim
-CFLAGS += -Wall
-LDFLAGS += -L${simavr}/simavr/${OBJ} -lsimavr
tests_src = ${wildcard test_*.c}
tests = ${patsubst %.c, ${OBJ}/%.tst, ${tests_src}}
${OBJ}/%.tst: tests.c %.c
ifeq ($(V),1)
- $(CC) -MMD ${CFLAGS} ${LFLAGS} -o $@ $^ $(LDFLAGS)
+ $(CC) -MMD ${CPPFLAGS} ${CFLAGS} ${LFLAGS} -o $@ ${patsubst %.h,, ${^}} $(LDFLAGS)
else
@echo TST $@
- @$(CC) -MMD ${CFLAGS} ${LFLAGS} -o $@ $^ $(LDFLAGS)
+ @$(CC) -MMD ${CPPFLAGS} ${CFLAGS} ${LFLAGS} -o $@ ${patsubst %.h,, ${^}} $(LDFLAGS)
endif
run_tests: all