-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 758 Bytes
/
Makefile
File metadata and controls
41 lines (31 loc) · 758 Bytes
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
#Build tools
CC = gcc
CFLAGS += -std=c99 -Wall -g -fPIE -D_FORTIFY_SOURCE=2
LDFLAGS += -pie -lm
# Specify extensions of files to delete when cleaning
CLEANEXTS = o a
# Specify the target file and the install directory
OUTPUTFILE = libqth.a
INSTALLDIR = /usr/local/lib/
# Default target
.PHONY: all
all: $(OUTPUTFILE)
$(OUTPUTFILE): qth.o
ar rcs $@ $^
ranlib $@
.PHONY: install
install:
mkdir -p $(INSTALLDIR)
cp -p $(OUTPUTFILE) $(INSTALLDIR)
.PHONY: uninstall
uninstall:
rm -f $(INSTALLDIR)/$(OUTPUTFILE)
.PHONY: clean
clean:
for file in $(CLEANEXTS); do rm -f *.$$file; done
rm -f testlib
testlib: testmain.o $(OUTPUTFILE)
$(CC) $(LDFLAGS) -o $@ $?
./$@
# Indicate dependencies of .ccp files on .hpp files
qth.o: qth.h