forked from SkyLandTW/clevo-indicator
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
46 lines (33 loc) · 840 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
vpath %.c ../src
CC = gcc
CFLAGS = -c -Wall -std=gnu99
LDFLAGS =
DSTDIR := /usr/local
OBJDIR := obj
SRCDIR := src
SRC = clevo-indicator.c
OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(SRC))
TARGET = bin/clevo-indicator
CFLAGS += `pkg-config --cflags appindicator3-0.1`
LDFLAGS += `pkg-config --libs appindicator3-0.1`
all: $(TARGET)
install: $(TARGET)
@echo Install to ${DSTDIR}/bin/
@sudo install -m 4750 -g adm $(TARGET) ${DSTDIR}/bin/
test: $(TARGET)
@sudo chown root $(TARGET)
@sudo chgrp adm $(TARGET)
@sudo chmod 4750 $(TARGET)
$(TARGET): $(OBJ) Makefile
@mkdir -p bin
@echo linking $(TARGET) from $(OBJ)
@$(CC) $(OBJ) -o $(TARGET) $(LDFLAGS) -lm
clean:
rm $(OBJ) $(TARGET)
$(OBJDIR)/%.o : $(SRCDIR)/%.c Makefile
@echo compiling $<
@mkdir -p obj
@$(CC) $(CFLAGS) -c $< -o $@
#$(OBJECTS): | obj
#obj:
# @mkdir -p $@