orangeduck / Spring-It-On

Code for the article Spring-It-On
MIT License
104 stars 13 forks source link

Makefile for build in Linux ::) #1

Open blogdron opened 3 years ago

blogdron commented 3 years ago

Maybe it will be useful to someone if they do not know how to collect examples, but want to poke them with a stick ::)


Use: make build_depends && make all && make run Once built, the examples will run in turn. Use the right mouse button to interact, and the left mouse button to interact with the GUI.

P.S. The code for the game controller is not collected

CC=g++
INCLUDE_DIR = -I./
INCLUDE_DIR+= -I./depends/raylib/raylib/include
INCLUDE_DIR+= -I./depends/raygui/src
LIBRARY_DIR = -L./depends/raylib/raylib
LIBRARY_DIR+= -L./depends/raylib/raylib/external/glfw/src
LIBRARY_LINK = -lraylib -lglfw3 -ldl -pthread
BUILD_DEP = $(INCLUDE_DIR) $(LIBRARY_DIR) $(LIBRARY_LINK)

all: damper doublespring inertialization interpolation resonance smoothing springdamper timedspring velocityspring

clean:
    -rm damper doublespring inertialization interpolation resonance smoothing springdamper timedspring velocityspring
damper:
    $(CC) damper.c -o $@ $(BUILD_DEP)
resonance:
    $(CC) resonance.c -o $@ $(BUILD_DEP)
smoothing:
    $(CC) smoothing.c -o $@ $(BUILD_DEP)
timedspring:
    $(CC) timedspring.c -o $@ $(BUILD_DEP)
doublespring:
    $(CC) doublespring.c -o $@ $(BUILD_DEP)
springdamper:
    $(CC) springdamper.c -o $@ $(BUILD_DEP)
interpolation:
    $(CC) interpolation.c -o $@ $(BUILD_DEP)
inertialization:
    $(CC) inertialization.c -o $@ $(BUILD_DEP)
velocityspring:
    $(CC) velocityspring.c -o $@ $(BUILD_DEP)
run:
    ./damper;
    ./resonance;
    ./smoothing;
    ./timedspring;
    ./springdamper;
    ./doublespring;
    ./interpolation;
    ./inertialization;
    ./velocityspring;
build_depends:
    mkdir -p depends/raygui
    mkdir -p depends/raylib
    git clone --depth 1 https://github.com/raysan5/raylib.git depends/raylib
    git clone --depth 1 https://github.com/raysan5/raygui depends/raygui
    cd depends/raylib && cmake . && make

.SILENT: build_depends clean damper doublespring inertialization interpolation resonance smoothing springdamper timedspring velocityspring
orangeduck commented 3 years ago

Nice, thanks!