misc: Point to correct simavr include dirs
[simavr] / tests / Makefile
index e2d04c2..7bc3d34 100644 (file)
 #      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}}
@@ -45,10 +40,10 @@ axf: ${sources:.c=.axf}
 
 ${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