--- /dev/null
+
+UNAME = ${shell uname}
+
+ifeq (${UNAME}, Darwin)
+LDFLAGS += -framework GLUT -framework OpenGL
+else
+ifeq (${UNAME}, Linux)
+CFLAGS += ${shell pkg-config --cflags glu}
+LDFLAGS += ${shell pkg-config --libs glu} -lglut
+else
+CFLAGS += ${shell pkg-config --cflags glu glut} -DFREEBSD=1
+LDFLAGS += ${shell pkg-config --libs glu glut}
+endif
+endif
+
+ifeq (${UNAME}, FreeBSD)
+CFLAGS += -DFREEBSD=1 -DNO_ALLOCA=1
+endif
VPATH += ../parts
LDFLAGS += -lpthread
-ifneq (${shell uname}, Darwin)
-LDFLAGS += -lGL -lglut
-else
-LDFLAGS += -framework GLUT -framework OpenGL
-endif
+
+include ../Makefile.opengl
all: obj atmega48_charlcd.axf ${target}
VPATH += ../parts
LDFLAGS += -lpthread
-ifneq (${shell uname}, Darwin)
-LDFLAGS += -lGL -lglut
-else
-LDFLAGS += -framework GLUT -framework OpenGL
-endif
+
+include ../Makefile.opengl
all: obj ${firmware} ${target}
CFLAGS += -DMOTHERBOARD=91
CFLAGS += ${shell pkg-config --cflags pangocairo}
-ifneq (${shell uname}, Darwin)
-LDFLAGS += -lGL -lglut -lGLU
-else
-LDFLAGS += -framework GLUT -framework OpenGL
-endif
+include ../Makefile.opengl
+
LDFLAGS += ${shell pkg-config --libs pangocairo}
LDFLAGS += -lpthread -lutil -ldl
LDFLAGS += -lm
#ifndef __C_UTILS_H__
#define __C_UTILS_H__
+#ifndef NO_ALLOCA
+#include <alloca.h>
+#endif
#include "c_array.h"
/********************************************************************
memcpy(r, s, l);
return r;
}
+#ifndef NO_ALLOCA
static inline str_p str_adup(const str_p s)
{
size_t l = sizeof(*s) + s->len + 1;
r->rom = 1;
return r;
}
+#endif
static inline uint16_t str_hash(str_p s)
{
if (!s->hash) s->hash = crc16_string(s->str);
VPATH += ../parts
LDFLAGS += -lpthread -lutil
-ifneq (${shell uname}, Darwin)
-LDFLAGS += -lGL -lglut
-else
-LDFLAGS += -framework GLUT -framework OpenGL
-endif
+
+include ../Makefile.opengl
all: obj ${firmware} ${target}
VPATH += ../parts
LDFLAGS += -lpthread
-ifneq (${shell uname}, Darwin)
-LDFLAGS += -lGL -lglut
-else
-LDFLAGS += -framework GLUT -framework OpenGL
-endif
+
+include ../Makefile.opengl
all: obj ${firmware} ${target}