-include ../../Makefile.cfg
-CPPFLAGS += -I include/ -I ../include/
-CFLAGS += -std=gnu99
DIR := Apps/AxWin/3.0
BIN := AxWinWM
-OBJ := main.o input.o video.o ipc.o image.o
-OBJ += wm.o wm_input.o wm_render.o wm_render_text.o wm_hotkeys.o
-OBJ += decorator.o
-OBJ += renderers/framebuffer.o
-OBJ += renderers/background.o
-OBJ += renderers/menu.o
-OBJ += renderers/richtext.o
-# TODO: Move to a lower makefile
-OBJ += renderers/widget.o
-OBJ += renderers/widget/button.o
-OBJ += renderers/widget/image.o
-OBJ += renderers/widget/disptext.o
-OBJ += renderers/widget/textinput.o
-OBJ += renderers/widget/spacer.o
-OBJ += renderers/widget/subwin.o
-
-PNGIMAGES := toolbar_new.png toolbar_save.png toolbar_open.png
-
-LDFLAGS += -limage_sif -luri -lnet -lunicode
-
-IMG2SIF = ../../../../Tools/img2sif
+OBJ := main.o input.o video.o ipc.o
+include common.mk
+
+LDFLAGS += -lnet
-include ../../Makefile.tpl
install: install_resources
-#all: resources/LogoSmall.sif.res.h
-
-%.res.h: % Makefile
- echo "#define RESOURCE_$(notdir $<) \\"| sed -e 's/\./_/g' > $@
- base64 $< | sed -e 's/.*/"&"\\/' >> $@
- echo "" >> $@
-
-$(IMG2SIF):
- $(MAKE) -C $(dir $(IMG2SIF)) img2sif
-
-all: $(addprefix resources/,$(PNGIMAGES:%.png=.%.sif))
-
-resources/.%.sif: $(IMG2SIF) Makefile resources/%.png
- @echo img2sif resources/$*.png
- @$(IMG2SIF) --rle1x32 resources/$*.png resources/.$*.sif
-
install_%.sif: resources/.%.sif ;
@echo [xCP] $(DISTROOT)/$(DIR)/$*.sif
@$(xCP) $< $(DISTROOT)/$(DIR)/$*.sif
--- /dev/null
+
+CPPFLAGS += -I include/ -I ../include/
+CFLAGS += -std=gnu99
+
+OBJ += image.o wm.o wm_input.o wm_render.o wm_render_text.o wm_hotkeys.o
+OBJ += decorator.o
+OBJ += renderers/framebuffer.o
+OBJ += renderers/background.o
+OBJ += renderers/menu.o
+OBJ += renderers/richtext.o
+# TODO: Move to a lower makefile
+OBJ += renderers/widget.o
+OBJ += renderers/widget/button.o
+OBJ += renderers/widget/image.o
+OBJ += renderers/widget/disptext.o
+OBJ += renderers/widget/textinput.o
+OBJ += renderers/widget/spacer.o
+OBJ += renderers/widget/subwin.o
+
+LDFLAGS += -limage_sif -luri -lunicode
+
+PNGIMAGES := toolbar_new.png toolbar_save.png toolbar_open.png
+IMG2SIF = ../../../../Tools/img2sif
+
+all: $(addprefix resources/,$(PNGIMAGES:%.png=.%.sif))
+
+%.res.h: % Makefile
+ echo "#define RESOURCE_$(notdir $<) \\"| sed -e 's/\./_/g' > $@
+ base64 $< | sed -e 's/.*/"&"\\/' >> $@
+ echo "" >> $@
+
+$(IMG2SIF):
+ $(MAKE) -C $(dir $(IMG2SIF)) img2sif
+
+resources/.%.sif: $(IMG2SIF) Makefile resources/%.png
+ @echo img2sif resources/$*.png
+ @$(IMG2SIF) --rle1x32 resources/$*.png resources/.$*.sif
+
#ifndef _COMMON_H_
#define _COMMON_H_
+#ifndef AXWIN_SDL_BUILD
#include <acess/sys.h>
+#else
+#include <stdio.h>
+#define _SysDebug(f,a...) fprintf(stderr, f"\n" ,## a)
+#endif
#define TODO(str)
static inline int MIN(int a, int b) { return (a < b) ? a : b; }
static inline int MAX(int a, int b) { return (a > b) ? a : b; }
-// === GLOBALS ===
-extern int giTerminalFD;
-extern const char *gsTerminalDevice;
-
extern int giScreenWidth, giScreenHeight;
-// === FUNCTIONS ===
-// --- Input ---
-extern int Input_Init(void);
-extern void Input_FillSelect(int *nfds, fd_set *set);
-extern void Input_HandleSelect(fd_set *set);
-// --- IPC ---
-extern void IPC_Init(void);
-extern void IPC_FillSelect(int *nfds, fd_set *set);
-extern void IPC_HandleSelect(fd_set *set);
-
#endif
#ifndef _IMAGE_H_
#define _IMAGE_H_
+#include <stdint.h>
+
typedef struct sImage tImage;
struct sImage
--- /dev/null
+/*
+ * Acess2 Window Manager v3 (axwin3)
+ * - By John Hodge (thePowersGang)
+ *
+ * include/lowlevel.h
+ * - Definitions for system-dependent code
+ */
+#ifndef _LOWLEVEL_H_
+#define _LOWLEVEL_H_
+
+#include <acess/sys.h>
+
+// === GLOBALS ===
+extern int giTerminalFD;
+extern const char *gsTerminalDevice;
+
+// === FUNCTIONS ===
+// --- Input ---
+extern int Input_Init(void);
+extern void Input_FillSelect(int *nfds, fd_set *set);
+extern void Input_HandleSelect(fd_set *set);
+// --- IPC ---
+extern void IPC_Init(void);
+extern void IPC_FillSelect(int *nfds, fd_set *set);
+extern void IPC_HandleSelect(fd_set *set);
+
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include <axwin3/keysyms.h>
+#include <string.h>
+#include "include/lowlevel.h"
// === IMPORTS ===
extern void Video_Setup(void);
#include <video.h>
#include <wm.h>
#include <string.h>
+#include "include/lowlevel.h"
// === IMPORTS ===
extern int giTerminalFD_Input;