-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
41 lines (27 loc) · 877 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
#!/usr/bin/make -f
CLAWSMAIL_SRC ?= /usr/src/claws-mail*/src
PROGRAM = clawsmail-passdecrypt
PROGRAM_SOURCES = clawsmail-passdecrypt.c
PROGRAM_PACKAGES = glib-2.0
PROGRAM_CFLAGS = -I$(CLAWSMAIL_SRC)/common
PROGRAM_LDFLAGS = -lcrypt
#=============================================================================#
CC ?= cc
PKG_CONFIG ?= pkg-config
RM ?= rm -f
CFLAGS ?= -O2 -g
LDFLAGS ?=
PROGRAM_CFLAGS += `$(PKG_CONFIG) --cflags $(PROGRAM_PACKAGES) 2>/dev/null`
PROGRAM_LDFLAGS += `$(PKG_CONFIG) --libs $(PROGRAM_PACKAGES) 2>/dev/null`
OBJECTS = $(PROGRAM_SOURCES:.c=.o)
.SUFFIXES:
.SUFFIXES: .c .o
.PHONY: all clean distclean
all: $(PROGRAM)
$(PROGRAM): $(OBJECTS)
$(CC) -o $@ $(OBJECTS) $(PROGRAM_LDFLAGS) $(LDFLAGS)
.c.o:
$(CC) -o $@ -c $< $(PROGRAM_CFLAGS) $(CFLAGS)
clean:
$(RM) $(OBJECTS) $(PROGRAM)
distclean: clean