forked from goToMain/libosdp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (36 loc) · 883 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
39
40
41
42
43
44
45
46
47
ifeq ($(wildcard config.mak),)
$(error run ./configure first. See ./configure -h)
endif
include config.mak
O ?= .
OBJ := $(SRC:%.c=$(O)/%.o)
CCFLAGS += -Wall -Wextra -O3 -Iinclude -Isrc -I. -Iutils/include
ifeq ($(VERBOSE),)
MAKE := make -s
Q := @
else
Q :=
MAKE := make
endif
all: $(O)/libosdp.a samples
$(O)/libosdp.a: $(OBJ)
@echo " AR $@"
$(Q)$(AR) qc $@ $^
$(O)/%.o: %.c
@echo " CC $<"
@mkdir -p $(@D)
$(Q)$(CC) -c $< $(CCFLAGS) -o $@
.PHONY: samples
samples: ${OSDP_SAMPLES}
cp_app.out:
@echo "LINK $@"
$(Q)$(CC) $(CCFLAGS) samples/c/cp_app.c -o cp_app.out -Iinclude -L. -losdp
pd_app.out:
@echo "LINK $@"
$(Q)$(CC) $(CCFLAGS) samples/c/pd_app.c -o pd_app.out -Iinclude -L. -losdp
.PHONY: clean
clean:
$(Q)rm -f $(OBJ) $(O)/src/*.o $(O)/libosdp.a cp_app.out pd_app.out
.PHONY: distclean
distclean: clean
$(Q)rm -f config.mak osdp_config.h osdp_export.h