summaryrefslogtreecommitdiff
path: root/src/make.mk
blob: 33d9033b0b3d0114a0a6ec09c320aaa5f35dcdbe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
DIR_SRC=src
SRC_LIB += $(wildcard $(DIR_SRC)/*.c)
OBJ_LIB += $(SRC_LIB:.c=.o)
LDFLAGS_LIB=`pkg-config --libs libusb` -lc

$(DIR_SRC)-lib-o: $(OBJ_LIB)

$(DIR_SRC)-lib: $(DIR_SRC)-lib-o
	gcc -shared -Wl,-soname,lib$(PROJECT).so -o lib$(PROJECT).so $(subst $(DIR_SRC)/,$(BUILD_DIR)$(DIR_SRC)/,$(OBJ_LIB)) $(LDFLAGS_LIB) 
	ar rcv lib$(PROJECT).a $(subst $(DIR_SRC)/,$(BUILD_DIR)$(DIR_SRC)/,$(OBJ_LIB))

$(DIR_SRC)/%.o: $(DIR_SRC)/%.c
	$(CC) $(CFLAGS) -fPIC $(INCLUDE) -c $< -o $(BUILD_DIR)$@