261a3f53163828c7806a278c37ccfc8c05492d50
[cgds.git] / src / Makefile
1 CC = gcc
2 CFLAGS = -g -std=gnu99 -fPIC
3 LDFLAGS = -shared
4 INCLUDES = -I..
5
6 SRC_DIR = ./
7 OBJ_DIR = ./obj
8
9 TARGET = $(OBJ_DIR)/libcgds.so
10
11 SRC_FILES = $(wildcard $(SRC_DIR)/*.c)
12 OBJ_FILES = $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRC_FILES))
13
14 all: $(TARGET)
15
16 $(TARGET): $(OBJ_FILES)
17 $(CC) $(LDFLAGS) -o $@ $^
18
19 $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(SRC_DIR)/%.h
20 $(CC) $(CFLAGS) $(INCLUDES) -o $@ -c $<
21
22 clean:
23 rm -f $(OBJ_DIR)/*.o $(TARGET)
24
25 .PHONY: all clean