Changeset 15c7ed9 in opengl-game for makefile


Ignore:
Timestamp:
Feb 23, 2017, 2:28:24 AM (8 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
4d52702
Parents:
5540132
Message:

Change the makefile to fully support mac and linux and add preprocessor driectives to detect the OS in the C++ code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • makefile

    r5540132 r15c7ed9  
    11OS = $(shell uname)
     2CC = g++
     3CFLAGS = -std=c++0x -Wall -pedantic #-Wextra
    24
    35ifeq ($(OS),Darwin)
    4         CHECK = OSX
    5         CC = g++ game.cpp -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -lglfw3 -lglew -Wall -o game
     6        DEP = -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -lglfw3 -lglew
    67endif
    7 ifeq ($(OS),Lolbol)
    8         CHECK = LINUX
    9         CC = g++ game.cpp -lglfw3 -lGLEW -lGL -ldl -lX11 -lXrandr -lXxf86vm -lXinerama -lXcursor  -pthread -Wall -std=c++0x -o game
     8ifeq ($(OS),Linux)
     9        DEP = -lglfw3 -lGLEW -lGL -ldl -lX11 -lXrandr -lXxf86vm -lXinerama -lXcursor  -pthread
    1010endif
    1111
    1212game: game.cpp
    13         @echo $(CHECK)
    14         $(CC)
     13        $(CC) $? $(DEP) $(CFLAGS) -o $@
    1514
    1615clean:
Note: See TracChangeset for help on using the changeset viewer.