-OBJ = \
- util.o \
- code.o \
- ast.o \
- ir.o \
- con.o
-OBJ_A = test/ast-test.o
-OBJ_I = test/ir-test.o
-OBJ_C = main.o lexer.o parser.o
-OBJ_X = exec-standalone.o util.o con.o
-
-#default is compiler only
-default: gmqcc
+OBJ_D = util.o code.o ast.o ir.o conout.o ftepp.o opts.o file.o utf8.o
+OBJ_T = test.o util.o conout.o file.o
+OBJ_C = main.o lexer.o parser.o file.o
+OBJ_X = exec-standalone.o util.o conout.o file.o
+
+ifneq ("$(CYGWIN)", "")
+ #nullify the common variables that
+ #most *nix systems have (for windows)
+ PREFIX :=
+ BINDIR :=
+ DATADIR :=
+ MANDIR :=
+ QCVM = qcvm.exe
+ GMQCC = gmqcc.exe
+ TESTSUITE = testsuite.exe
+else
+ifneq ("$(MINGW)", "")
+ #nullify the common variables that
+ #most *nix systems have (for windows)
+ PREFIX :=
+ BINDIR :=
+ DATADIR :=
+ MANDIR :=
+ QCVM = qcvm.exe
+ GMQCC = gmqcc.exe
+ TESTSUITE = testsuite.exe
+else
+ #arm support for linux .. we need to allow unaligned accesses
+ #to memory otherwise we just segfault everywhere
+ ifneq (, $(findstring arm, $(shell uname -m)))
+ CFLAGS += -munaligned-access
+ endif
+
+ QCVM = qcvm
+ GMQCC = gmqcc
+ TESTSUITE = testsuite
+endif
+endif
+
+#standard rules
+default: all