forked from vgteam/gssw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (28 loc) · 751 Bytes
/
Makefile
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
CC:=gcc
CFLAGS:=-Wall -O3 -msse4
OBJ_DIR:=obj
BIN_DIR:=bin
SRC_DIR:=src
LIB_DIR:=lib
OBJ=gssw.o
EXE=gssw_example
EXEADJ= gssw_example_adj
.PHONY:all clean cleanlocal pre
all:$(BIN_DIR)/$(EXE) $(BIN_DIR)/$(EXEADJ) $(LIB_DIR)/libgssw.a
pre:
mkdir -p bin
mkdir -p obj
mkdir -p lib
$(BIN_DIR)/$(EXE):$(OBJ_DIR)/$(OBJ) $(SRC_DIR)/example.c pre
$(CC) $(CFLAGS) $(SRC_DIR)/example.c -o $@ $< -lm -lz
$(BIN_DIR)/$(EXEADJ):$(OBJ_DIR)/$(OBJ) $(SRC_DIR)/example_adj.c pre
$(CC) $(CFLAGS) $(SRC_DIR)/example_adj.c -o $@ $< -lm -lz
$(OBJ_DIR)/$(OBJ):$(SRC_DIR)/gssw.h pre
$(CC) $(CFLAGS) -c -o $@ $(SRC_DIR)/gssw.c
$(LIB_DIR)/libgssw.a:$(OBJ_DIR)/$(OBJ) pre
ar rvs $@ $<
cleanlocal:
$(RM) -r lib/
$(RM) -r bin/
$(RM) -r obj/
clean:cleanlocal