-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (43 loc) · 1.32 KB
/
Makefile
File metadata and controls
55 lines (43 loc) · 1.32 KB
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
prefix := /usr/local
exec_prefix := $(prefix)
includedir := $(prefix)/include
libdir := $(prefix)/lib
datarootdir := /usr/local/share
docdir := $(datarootdir)/doc/libgfx
pkgconfigdir = $(libdir)/pkgconfig
SHELL := /bin/sh
CFLAGS := `pkg-config --cflags libpng` -Iinclude
.PHONY: all install doc clean uninstall
all: lib/libgfx.a doc
clean:
@rm -rf obj
install: all
@echo Copying libgfx.a to $(libdir)/libgfx.a...
@cp lib/libgfx.a $(libdir)/libgfx.a
@echo Copying libgfx.h to $(includedir)/libgfx.h...
@cp include/libgfx.h $(includedir)/libgfx.h
@echo Copying documentation to $(docdir)...
@mkdir -p $(docdir)
@cp -r -t $(docdir) doc/*
@echo Generating $(pkgconfigdir)/libgfx.pc...
@echo 'libdir=$(libdir)\nincludedir=$(includedir)\n' | cat - libgfx.pc > $(pkgconfigdir)/libgfx.pc
uninstall:
@echo Removing $(pkgconfigdir)/libgfx.pc...
@rm -f $(pkgconfigdir)/libgfx.pc
@echo Removing $(docdir)...
@rm -rf $(docdir)
@echo Removing $(includedir)/libgfx.h
@rm -f $(includedir)/libgfx.h
@echo Removing $(libdir)/libgfx.a...
@rm -f $(libdir)/libgfx.a...
doc:
@echo Generating documentation...
@cd doc && doxygen > /dev/null 2>&1
lib/libgfx.a: obj/libgfx.o
@echo Generating archive...
@mkdir -p lib
@ar rvs lib/libgfx.a obj/libgfx.o
obj/libgfx.o: src/libgfx.c
@echo Compiling...
@mkdir -p obj
@$(CC) $(CFLAGS) -o $@ -c $^