-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.linux64
42 lines (33 loc) · 1.15 KB
/
Makefile.linux64
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
36
37
38
39
40
41
CC = clang
SRC_PTH = ./src
INC_PTH = -I. -I./include/ -I./dependancies/ -I/usr/include
BLD_PTH = ./obj/
LIB_PTH = ./lib
LIB_NAME = slenderer.x86_64
CFLAGS = -std=gnu99 -DVUL_LINUX -Wall -Wno-unused-function -Wno-unused-variable -fno-strict-aliasing -g -DVUL_VECTOR_C89_ITERATORS $(INC_PTH)
LDFLAGS = -L$(LIB_PTH) -l$(LIB_NAME) -lGLEW -lglfw3 -lm -lrt -lGL -lGLU -lX11 -lXrandr -lXi -lXxf86vm -lXcursor -lpthread -ldl -lXinerama
SHELL = /bin/bash
SOURCES = $(shell find $(SRC_PTH)/ -name '*.c')
OBJECTS = $(SOURCES:$(SRC_PTH)/%.c=%)
OBJECT_PATHS = $(SOURCES:$(SRC_PTH)/%.c=$(BLD_PTH)%.o)
.PHONE: pre
@echo "Beginning build"
$(MAKE) all --no-pring-directory
.PHONY: dirs
dirs:
@echo "Creating directories"
@mkdir -p $(dir $(OBJECT_PATHS))
@mkdir -p $(LIB_PTH)
.PHONY: clean
clean:
@echo "Deleting directories"
@$(RM) -r $(BLD_PTH)
@$(RM) -r $(LIB_PTH)/$(LIB_NAME)
all: dirs $(LIB_PTH)/$(LIB_NAME)
$(LIB_PTH)/$(LIB_NAME): $(OBJECTS)
ar rcs $(LIB_PTH)/lib$(LIB_NAME).a $(OBJECT_PATHS)
$(OBJECTS): $(SOURCES)
@echo "Compiling: $(SRC_PTH)/[email protected] to $(BLD_PTH)[email protected]"
$(CMD_PREFIX)$(CC) $(CFLAGS) -c $(SRC_PTH)/[email protected] -o $(BLD_PTH)[email protected]
$(SOURCES):
@echo "Found $@"