Fix some problems with the bin2char utility
[fw/openocd] / src / target / Makefile.am
index efbeb33afd190c8140020cb61b18d9d658f0f893..bf80c64c021aa9ef4e261751ff31a5ec057f9147 100644 (file)
@@ -16,12 +16,12 @@ EXTRA_DIST = \
        startup.tcl \
        $(wildcard $(srcdir)/xscale/*)
 
-DEBUG_HEADER   = xscale_debug.h
+DEBUG_HEADER   = xscale_debug.inc
 BUILT_SOURCES = $(DEBUG_HEADER)
 CLEANFILES = $(DEBUG_HEADER)
 
-$(DEBUG_HEADER): $(BIN2C) $(DEBUG_HANDLER)
-       $(BIN2C) < $(DEBUG_HANDLER) xscale_debug_handler > xscale_debug.h
+$(DEBUG_HEADER): $(DEBUG_HANDLER) $(BIN2C)
+       $(BIN2C) < $< > $@ || { rm -f $@; false; }
 
 METASOURCES = AUTO
 noinst_LTLIBRARIES = libtarget.la