-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (83 loc) · 2.36 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
-include config.mk
CFLAGS += -Wall -std=c99 -pedantic -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L
all: config.mk outdir pkg-config
config.mk:
@if ! test -e config.mk; then printf "\033[31;1mERROR:\033[0m you have to run ./configure\n"; exit 1; fi
OBJ = out/cflags.o \
out/flag.o \
out/globals.o \
out/libs.o \
out/main.o \
out/package.o \
out/parse.o \
out/reqver.o \
out/strutil.o \
out/taillist.o \
out/utils.o
$(OBJ):
$(QUIET_CC)$(CC) $(CFLAGS) -c src/$(@F:.o=.c) -o $@
pkg-config: $(OBJ)
$(QUIET_LINK)$(CC) $^ $(LIBS) -o out/$@
outdir:
@mkdir -p out
install:
@echo installing pkg-config
@mkdir -p $(DESTDIR)$(BIN_DIR)
@cp -f out/pkg-config $(DESTDIR)$(BIN_DIR)
@strip -s $(DESTDIR)$(BIN_DIR)/pkg-config
@chmod 755 $(DESTDIR)$(BIN_DIR)/pkg-config
@echo installing pkg-config.pc
@mkdir -p $(DESTDIR)$(SHARE_DIR)/pkg-config
@cp -f data/pkg-config.pc $(DESTDIR)$(SHARE_DIR)/pkg-config
@chmod 644 $(DESTDIR)$(SHARE_DIR)/pkg-config/pkg-config.pc
@echo installing manual
@mkdir -p $(DESTDIR)$(MAN_DIR)
@cp -f data/pkg-config.1 $(DESTDIR)$(MAN_DIR)
@gzip -f -9 $(DESTDIR)$(MAN_DIR)/pkg-config.1
@chmod 644 $(DESTDIR)$(MAN_DIR)/pkg-config.1.gz
uninstall:
@echo uninstalling pkg-config
@rm -f $(DESTDIR)$(BIN_DIR)/pkg-config
@echo uninstalling pkg-config.pc
@rm -f $(DESTDIR)$(SHARE_DIR)/pkg-config/pkg-config.pc
@echo uninstalling manual
@rm -f $(DESTDIR)$(MAN_DIR)/pkg-config.1.gz
clean:
@echo removing pkg-config output files..
@rm -f out/*.o
@rm -f
distclean: clean
@echo removing config.mk include file
@rm -f config.mk
check:
@test/check-cflags
@test/check-libs
@test/check-mixed-flags
@test/check-non-l-flags
@test/check-define-variable
@test/check-libs-private
@test/check-requires-private
@test/check-circular-requires
@test/check-includedir
@test/check-conflicts
@test/check-missing
@test/check-special-flags
@test/check-sort-order
@test/check-duplicate-flags
@test/check-whitespace
@test/check-cmd-options
@test/check-version
@test/check-requires-version
@test/check-print-options
@test/check-path
@test/check-sysroot
@test/check-uninstalled
@test/check-debug
@test/check-gtk
@test/check-tilde
@test/check-relocatable
@test/check-variable-override
@test/check-variables
@test/check-dependencies
@test/check-system-flags
.PHONY: all clean distclean install uninstall check