#ifndef CPU_DETECT_H
#define CPU_DETECT_H
-/* sparse? */
-#ifdef __CHECKER__
- /* Any random CPU will do */
- #define __arm__
-#endif
-
#if defined(__arm__) /* GCC */ \
|| defined(__ARM4TM__) /* IAR: defined for all cores >= 4tm */
#define CPU_ARM 1
*
* \see MOD_INIT(), MOD_CHECK()
*/
-#define MOD_DEFINE(module) DB(bool module ## _initialized;)
+#define MOD_DEFINE(module) DB(extern bool module ## _initialized; bool module ## _initialized;)
/**
* Check that \a module was already initialized.
# Author: Bernardo Innocenti <bernie@develer.com>
#
# $Log$
+# Revision 1.12 2007/09/29 16:57:39 bernie
+# Better sparse support.
+#
# Revision 1.11 2007/09/29 15:54:14 bernie
# Make demo Qt emulator compile again.
#
RM_R = rm -rf
RN = mv
MKDIR_P = mkdir -p
+SHELL = /bin/sh
+CHECKER = sparse
+DOXYGEN = doxygen
+AVRDUDE = avrdude
+FLEXCAT = $(top_srcdir)/tools/flexcat/flexcat
# For conversion from ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
COFFCONVERT=$(OBJCOPY) \
LIBDIR = lib
OBJDIR = obj
OUTDIR = images
-SHELL = /bin/sh
-DOXYGEN = doxygen
-UISP = uisp
-AVRDUDE = avrdude
-FLEXCAT = $(top_srcdir)/tools/flexcat/flexcat
# output format can be srec, ihex (avrobj is always created)
FORMAT = srec
#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
-#include <sys/time.h>
+#include <sys/time.h> /* for gettimeofday() */
+#include <stddef.h> /* for NULL */
hptime_t hptime_get(void)
{
struct timeval tv;
- gettimeofday(&tv, 0);
+ gettimeofday(&tv, NULL);
return (hptime_t)tv.tv_sec * HPTIME_TICKS_PER_SECOND
+ (hptime_t)tv.tv_usec;
}
#ifndef HPTIME_H
#define HPTIME_H
-/* sparse? */
-#ifdef __CHECKER__
- /* Any random OS would do */
- #define __unix__
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
L := @echo
endif
+# Checker build
+ifeq ($(C),1)
+CC = $(CHECKER)
+CFLAGS += -Wundef -D__x86_64__=1 -D__unix__=1 -D__linux__=1 -D__STDC_VERSION__=199901L
+endif
+
# Initialize $(top_srcdir) with current directory, unless it was already initialized
top_srcdir ?= $(shell pwd)