Changeset ab65f84 in opengl-game for makefile


Ignore:
Timestamp:
Jul 2, 2019, 5:16:02 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
b6127d2
Parents:
826df16
Message:

Get the vulkangame makefile target working in both Linux and OSX

File:
1 edited

Legend:

Unmodified
Added
Removed
  • makefile

    r826df16 rab65f84  
    22OS = $(shell uname)
    33CC = g++
    4 CFLAGS = -std=c++11 -Wall -pedantic -rdynamic
     4CFLAGS = -std=c++17 -Wall -pedantic -rdynamic
    55# -rdynamic is to generate debug info for dynamic symbols on debian-based
    66# systems (tested on Linux Mint)
     
    3434        $(CC) $^ $(DEP) $(CFLAGS) -o $@
    3535
    36 # from the mac makefile
    37 #CXX_INCLUDES = -I/Users/dportnoy15/Development/vulkan-sdk-macos-1.1.108.0/macOS/include -I/usr/local/Cellar/sdl2/2.0.9_1/include/SDL2
    38 #LIBFLAGS =  -Wl,-rpath,$(VULKAN_SDK_PATH)/macOS/lib $(VULKAN_SDK_PATH)/macOS/lib/libvulkan.dylib -L/usr/local/Cellar/sdl2/2.0.9_1/lib -lSDL2
     36CXX_FLAGS = -std=c++17 -Wall -pedantic # -O3 -rdynamic
    3937
    40 CXX_FLAGS = -std=c++17 -Wall -pedantic # -O3
     38ifeq ($(OS),Darwin)
     39        VULKAN_SDK_PATH = /Users/dportnoy15/Development/vulkan-sdk-macos-1.1.108.0/macOS
     40endif
     41ifeq ($(OS),Linux)
     42        VULKAN_SDK_PATH = /home/dportnoy/Desktop/VulkanSDK/1.1.106.0/x86_64
     43endif
    4144
    42 VULKAN_SDK_PATH = /home/dportnoy/Desktop/VulkanSDK/1.1.106.0/x86_64
     45LIB_PATHS =  -I$(VULKAN_SDK_PATH)/include
     46ifeq ($(OS),Darwin)
     47        LIB_PATHS := -Wl,-rpath,$(VULKAN_SDK_PATH)/lib $(LIB_PATHS)
     48endif
     49ifeq ($(OS),Linux)
     50        LIB_PATHS := -L$(VULKAN_SDK_PATH)/lib $(LIB_PATHS)
     51endif
    4352
    44 LIB_PATHS = -L$(VULKAN_SDK_PATH)/lib -I$(VULKAN_SDK_PATH)/include
    45 LIBS = -lvulkan -lSDL2
     53LIBS = -lSDL2
     54ifeq ($(OS),Darwin)
     55        LIBS := $(VULKAN_SDK_PATH)/lib/libvulkan.dylib $(LIBS)
     56endif
     57ifeq ($(OS),Linux)
     58        LIBS := -lvulkan $(LIBS)
     59endif
    4660
    4761LIB_FLAGS = $(LIB_PATHS) $(LIBS)
Note: See TracChangeset for help on using the changeset viewer.