From dfd2fcd99bf88c5e0cd9c3703db0f4cbde01d361 Mon Sep 17 00:00:00 2001 From: Michaelangel007 Date: Mon, 29 Dec 2014 14:46:24 -0800 Subject: [PATCH] Add Linux support to makefile --- makefile.osx | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/makefile.osx b/makefile.osx index c41de95..45ca3f8 100644 --- a/makefile.osx +++ b/makefile.osx @@ -1,12 +1,28 @@ -TARGET=bin/hgr2rgb.x +# --- Platform --- +# http://stackoverflow.com/questions/714100/os-detecting-makefile +ifeq ($(OS),Windows_NT) + echo "Use MSVC Solution/Project" +else + UNAME = $(shell uname -s) + + ifeq ($(UNAME),Linux) + TARGET=bin/hgr2rgb.elf + endif + ifeq ($(UNAME),Darwin) + TARGET=bin/hgr2rgb.osx + endif +endif + +# --- Common --- + all: $(TARGET) -C_FLAGS=-Wall -Wextra -Isrc - - clean: - rm $(TARGET) + @if [ -a $(TARGET) ] ; then rm $(TARGET); fi; -bin/hgr2rgb.x: src/main.cpp src/wsvideo.cpp src/wsvideo.h - g++ -g $(C_FLAGS) $< -o $@ +C_FLAGS=-Wall -Wextra -Isrc +DEP=src/main.cpp src/wsvideo.cpp src/wsvideo.h src/cs.cpp src/cs.h src/StdAfx.h + +$(TARGET): $(DEP) + g++ $(C_FLAGS) $< -o $@