From 35af32a3a6f257217a82e0249741e5f196c0123d Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 15 Apr 2015 19:14:28 -0400 Subject: [PATCH] Started building the make structure. --- new/GNUmakefile | 57 +++++++++++++++++++++++++++++++++++++++ new/windows/GNUmakeinc.mk | 33 +++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 new/GNUmakefile create mode 100644 new/windows/GNUmakeinc.mk diff --git a/new/GNUmakefile b/new/GNUmakefile new file mode 100644 index 0000000..2735929 --- /dev/null +++ b/new/GNUmakefile @@ -0,0 +1,57 @@ +# 15 april 2015 + +OBJDIR = .obj + +# windows does this so :/ +ifeq ($(OS),Windows_NT) +OS = windows +endif + +ifndef OS +UNAME = $(shell uname -s) +ifeq ($(UNAME),Darwin) +OS = darwin +else +OS = unix +endif +endif + +CFILES = \ + stack.c \ + test.c +HFILES = \ + ui.h \ + uipriv.h \ + ui_$(OS).h \ + $(OS)/uipriv_$(OS).h + +xCFLAGS = \ + -g \ + -Wall -Wextra \ + -Wno-unused-parameter \ + --std=c99 \ + $(CFLAGS) +xLDFLAGS = \ + -g \ + $(LDFLAGS) + +include $(OS)/GNUmakeinc.mk +xOSCFILES = $(OSCFILES:%=$(OS)/%) + +OFILES = $(CFILES:%.c=$(OBJDIR)/%.o) \ + $(xOSCFILES:$(OS)/%.c=$(OBJDIR)/%_$(OS).o) + +$(OUT): $(OFILES) + $(CC) -o $(OUT) $(OFILES) $(xLDFLAGS) + +$(OBJDIR)/%.o: %.c $(OBJDIR) $(HFILES) + $(CC) -o $@ -c $< $(xCFLAGS) + +$(OBJDIR)/%_$(OS).o: $(OS)/%.c $(OBJDIR) $(HFILES) + $(CC) -o $@ -c $< $(xCFLAGS) + +$(OBJDIR): + mkdir -p $(OBJDIR) + +ui.h: ui.idl + idl2h < ui.h > ui.idl diff --git a/new/windows/GNUmakeinc.mk b/new/windows/GNUmakeinc.mk new file mode 100644 index 0000000..494b8e3 --- /dev/null +++ b/new/windows/GNUmakeinc.mk @@ -0,0 +1,33 @@ +OSCFILES = \ + alloc.c \ + button.c \ + checkbox.c \ + comctl32.c \ + debug.c \ + entry.c \ + init.c \ + label.c \ + main.c \ + newcontrol.c \ + parent.c \ + tab.c \ + text.c \ + util.c \ + window.c + +xLDFLAGS += \ + -luser32 -lkernel32 -lgdi32 -luxtheme -lmsimg32 -lcomdlg32 -lole32 -loleaut32 -loleacc -luuid + +OUT = new.exe + +ifeq ($(ARCH),64) + CC = x86_64-w64-mingw32-gcc + RC = x86_64-w64-mingw32-windres + xCFLAGS += -m64 + xLDFLAGS += -m64 +else + CC = i686-w64-mingw32-gcc + RC = i686-w64-mingw32-windres + xCFLAGS += -m32 + xLDFLAGS += -m32 +endif