This needs to run on the host system, not on the target system.
This way we can cross-compile the microcode if you have a C
cross-compiler handy, which makes iterating development a lot faster
when the target's native C compiler is painfully slow.
AC_PROG_LN_S
AC_PROG_MAKE_SET
+: ${HOST_CC:=${CC}}
+
if test x"${GCC}" = xyes; then
dnl Discard flags computed by AC_PROG_CC; we'll use our own.
AC_SUBST([EXE_NAME])
AC_SUBST([INSTALL_INCLUDE])
AC_SUBST([CCLD])
+AC_SUBST([HOST_CC])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
AUXDIR = $(libdir)/$(AUXDIR_NAME)
CC = @CC@
+HOST_CC = @HOST_CC@
CCLD = @CCLD@
M4 = $(srcdir)/makegen/m4.sh @M4@
AS = as
findprim: $(findprim_OBJECTS) $(findprim_DEPENDENCIES)
-rm -f $@
- $(LINK) $(findprim_LDFLAGS) $(findprim_OBJECTS) $(findprim_LIBS)
+ $(HOST_CC) -o $@ $(findprim_LDFLAGS) $(findprim_OBJECTS) \
+ $(findprim_LIBS)
+
+findprim.o: findprim.c config.h
+ $(HOST_CC) -o $@ $(findprim_CFLAGS) -c findprim.c
gen-nonce: gen-nonce.o
$(LINK) gen-nonce.o