~nerosnm/oslog

ref: a95e7078a0e929aedff5549172023a100db7aabf oslog/liboslog/Makefile -rw-r--r-- 603 bytes
a95e7078 — Søren Mortensen Rework oslog-sys configuration and paths to allow for `cargo package` 3 years ago
                                                                                
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
CC=clang
CFLAGS=-I$(INC_DIR)

INC_DIR=include

_DEPS = oslog.h
DEPS = $(patsubst %,$(INC_DIR)/%,$(_DEPS))

OBJ_DIR=obj

_OBJ = oslog.o
OBJ = $(patsubst %,$(OBJ_DIR)/%,$(_OBJ))

SRC_DIR=src

_SRC = oslog.c
SRC = $(patsubst %,$(SRC_DIR)/%,$(_SRC))

OUT_DIR=out

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(DEPS)
	@echo "[Compile]" $<
	@mkdir -p $(OBJ_DIR)
	@$(CC) -c -o $@ $< $(CFLAGS)

$(OUT_DIR)/liboslog.a: $(OBJ)
	@echo "[Link (Static)]" $<
	@mkdir -p $(OUT_DIR)
	@ar rcs $@ $^

$(OUT_DIR):
	@mkdir -p $(OUT_DIR)

.PHONY: clean $(OBJ_DIR) $(OUT_DIR)

clean:
	rm -f $(OBJ_DIR)/*.o $(OUT_DIR)/*.a

all: liboslog.a