-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
61 lines (47 loc) · 1018 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Makefile for Weather-Wiz
# @author: Methusael Murmu
DEP_GTK=gtk+-2.0
DEP_JSON=jansson
DEP_CURL=libcurl
DEP_APP_INDICATOR=appindicator-0.1
DEP_PACKAGE=$(DEP_GTK) $(DEP_JSON) $(DEP_CURL) $(DEP_APP_INDICATOR)
VPATH=src
INCLUDES=-I include
CC=gcc
CFLAGS=-Wall `pkg-config --cflags $(DEP_PACKAGE)`
LIBS=`pkg-config --libs $(DEP_PACKAGE)` -pthread
COMPILE=$(CC) $(INCLUDES) $(CFLAGS) -c
BIN_DIR=bin
SOURCES= \
main.c weather_backend.c \
timer_thread.c json_util.c \
util.c
OBJECTS=$(subst .c,.o,$(SOURCES))
BIN=weather-wiz
MKDIR=mkdir -p
RM=rm -rf
# Setup for bin
define perform_post_build
@if [ ! -d "$BIN_DIR" ]; then \
$(MKDIR) $(BIN_DIR); \
fi; \
mv $(BIN) $(BIN_DIR)/.; \
$(RM) *.o
endef
all: $(BIN)
$(BIN): $(OBJECTS)
$(CC) $^ -o $@ $(LIBS)
$(perform_post_build)
main.o: main.c
$(COMPILE) $<
weather_backend.o: weather_backend.c
$(COMPILE) $<
timer_thread.o: timer_thread.c
$(COMPILE) $<
json_util.o: json_util.c
$(COMPILE) $<
util.o: util.c
$(COMPILE) $<
.PHONY: clean
clean:
rm *.o