-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
35 lines (25 loc) · 759 Bytes
/
makefile
File metadata and controls
35 lines (25 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
CC = g++
CFLAGS = -fpic -c -Wall -std=c++11 -pedantic
LDFLAGS = -lGLEW -lGL
_OBJ = shader.o shader_program.o
OBJ = $(addprefix obj/,$(_OBJ))
# Include libs
LDFLAGS +=
all: libshader.a libshader.so libshader
obj/%.o: src/%.cpp
@mkdir -p $(@D)
$(CC) $(CFLAGS) -o $@ $^ -Iinclude
libshader.a: $(OBJ) $(LDFLAGS)
ar -rcs $@ $^
libshader.so: $(OBJ) $(LDFLAGS)
$(CC) -shared -o $@ $^
libshader: include/shader.hpp include/shader_program.hpp\
include/shader_error.hpp
cat $^ > $@
install: libshader.a libshader.so libshader
@mkdir -p "$$HOME/.local/lib" "$$HOME/.local/include"
cp libshader.a libshader.so "$$HOME/.local/lib/"
cp libshader "$$HOME/.local/include"
.PHONY: clean install
clean:
rm libshader libshader.a libshader.so obj/*