~nerosnm/oslog

ref: 617abaa34d5d75afff911155b8e70629dc96fc0f oslog/liboslog/Makefile -rw-r--r-- 740 bytes
617abaa3 — Søren Mortensen Fix or add missing file headers 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
40
41
42
43
44
45
46
47
#
#  Makefile
#  liboslog
#
#  Created by Søren Mortensen on 29/07/2018.
#  Copyright © 2018 Søren Mortensen. All rights reserved.
#

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