From cb4ebfdbd2f26e18ee6f692e8e0716865cbd03dd Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Fri, 16 Aug 2019 10:45:14 -0700 Subject: [PATCH] Dragging adam into CMake kicking and screaming :) --- Makefile | 29 ++++++-------------------- attic/Makefile | 28 +++++++++++++++++++++++++ make-bsd.mk => attic/make-bsd.mk | 0 make-linux.mk => attic/make-linux.mk | 0 make-mac.mk => attic/make-mac.mk | 0 make-netbsd.mk => attic/make-netbsd.mk | 0 objects.mk => attic/objects.mk | 0 7 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 attic/Makefile rename make-bsd.mk => attic/make-bsd.mk (100%) rename make-linux.mk => attic/make-linux.mk (100%) rename make-mac.mk => attic/make-mac.mk (100%) rename make-netbsd.mk => attic/make-netbsd.mk (100%) rename objects.mk => attic/objects.mk (100%) diff --git a/Makefile b/Makefile index 144225fc4..d7dba4231 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,11 @@ # Common makefile -- loads make rules for each platform -OSTYPE=$(shell uname -s) +BUILDDIR := build -ifeq ($(OSTYPE),Darwin) - include make-mac.mk -endif +.PHONY: all -ifeq ($(OSTYPE),Linux) - include make-linux.mk -endif +all: + mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. && $(MAKE) -ifeq ($(OSTYPE),FreeBSD) - CC=clang - CXX=clang++ - ZT_BUILD_PLATFORM=7 - include make-bsd.mk -endif -ifeq ($(OSTYPE),OpenBSD) - CC=egcc - CXX=eg++ - ZT_BUILD_PLATFORM=9 - include make-bsd.mk -endif - -ifeq ($(OSTYPE),NetBSD) - include make-netbsd.mk -endif +clean: + rm -rf ${BUILDDIR} diff --git a/attic/Makefile b/attic/Makefile new file mode 100644 index 000000000..144225fc4 --- /dev/null +++ b/attic/Makefile @@ -0,0 +1,28 @@ +# Common makefile -- loads make rules for each platform + +OSTYPE=$(shell uname -s) + +ifeq ($(OSTYPE),Darwin) + include make-mac.mk +endif + +ifeq ($(OSTYPE),Linux) + include make-linux.mk +endif + +ifeq ($(OSTYPE),FreeBSD) + CC=clang + CXX=clang++ + ZT_BUILD_PLATFORM=7 + include make-bsd.mk +endif +ifeq ($(OSTYPE),OpenBSD) + CC=egcc + CXX=eg++ + ZT_BUILD_PLATFORM=9 + include make-bsd.mk +endif + +ifeq ($(OSTYPE),NetBSD) + include make-netbsd.mk +endif diff --git a/make-bsd.mk b/attic/make-bsd.mk similarity index 100% rename from make-bsd.mk rename to attic/make-bsd.mk diff --git a/make-linux.mk b/attic/make-linux.mk similarity index 100% rename from make-linux.mk rename to attic/make-linux.mk diff --git a/make-mac.mk b/attic/make-mac.mk similarity index 100% rename from make-mac.mk rename to attic/make-mac.mk diff --git a/make-netbsd.mk b/attic/make-netbsd.mk similarity index 100% rename from make-netbsd.mk rename to attic/make-netbsd.mk diff --git a/objects.mk b/attic/objects.mk similarity index 100% rename from objects.mk rename to attic/objects.mk