-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (28 loc) · 1.04 KB
/
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
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
PATH := /usr/local/bin:$(PATH)
CC := clang
CFLAGS := $$(objfw-config --package OGEBook --package OGEBookContacts --package OGEDataServer --package OGCamel --package OGObject --cppflags)
OBJCFLAGS := $$(objfw-config --objcflags)
LIBS := $$(objfw-config --package OGEBook --package OGEBookContacts --package OGEDataServer --package OGCamel --package OGObject --rpath --libs)
OBJ := obj
SOURCES := $(wildcard *.m) $(wildcard Exception/*.m) $(wildcard Model/*.m)
OBJECTS := $(patsubst %.m, $(OBJ)/%.o, $(SOURCES))
contacts2phone: $(OBJECTS)
$(CC) $^ -o $@ $(LIBS)
$(OBJ)/%.o: %.m
@mkdir -p $(@D)
$(CC) $(OBJCFLAGS) $(CFLAGS) -c $< -o $@
$(OBJ)/Exception/%.o: Exception/%.m
@mkdir -p $(@D)
$(CC) $(OBJCFLAGS) $(CFLAGS) -c $< -o $@
$(OBJ)/Model/%.o: Model/%.m
@mkdir -p $(@D)
$(CC) $(OBJCFLAGS) $(CFLAGS) -c $< -o $@
build: contacts2phone
install: contacts2phone
@install -d $(DESTDIR)$(PREFIX)/bin/
@install -m 755 contacts2phone $(DESTDIR)$(PREFIX)/bin/
run: contacts2phone
@./contacts2phone