forked from rnjacobs/wmbubble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
106 lines (84 loc) · 2.37 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
97
98
99
100
101
102
103
104
105
106
ifneq (,)
This makefile requires GNU Make.
endif
INSTALL = install
INSTFLAGS = -m 755
VERSION = $(shell git describe --tags)
# where to install this program
DESTDIR =
PREFIX = /usr/local
# default build flags
# CFLAGS = -ansi -Wall -ggdb
# optimization cflags
CFLAGS += -ansi -Wall -O3
# profiling cflags
# CFLAGS = -ansi -Wall -O3 -pg -DPRO=50000
# LDFLAGS = -pg
# test coverage cflags
# CFLAGS = -ansi -Wall -ggdb -fprofile-arcs -ftest-coverage -DPRO=50000
SHELL=sh
OS = $(shell uname -s)
OBJS = bubblemon.o wmx11pixmap.o
CC = gcc
# special things for Linux
ifeq ($(OS), Linux)
OBJS += sys_linux.o
LIBS = -lX11 -lm
endif
# special things for FreeBSD
ifeq ($(OS), FreeBSD)
OBJS += sys_freebsd.o
LIBS = -lX11 -lm
endif
ifeq ($(OS), GNU/kFreeBSD)
OBJS += sys_freebsd.o
LIBS = -lX11 -lm
CFLAGS += -D_BSD_SOURCE
endif
# special things for NetBSD
ifeq ($(OS), NetBSD)
OBJS += sys_netbsd.o
LIBS = -lX11 -lkvm -lm
INSTFLAGS = -c -g kmem -m 2755 -o root
endif
# special things for OpenBSD
ifeq ($(OS), OpenBSD)
OBJS += sys_openbsd.o
LIBS = -lX11 -lm
endif
#special things for SunOS
ifeq ($(OS), SunOS)
# try to detect if gcc is available (also works if you call gmake CC=cc to
# select the sun compilers on a system with both)
COMPILER=$(shell \
if [ `$(CC) -v 2>&1 | egrep -c '(gcc|egcs|g\+\+)'` = 0 ]; then \
echo suncc; else echo gcc; fi)
# if not, fix up CC and the CFLAGS for the Sun compiler
ifeq ($(COMPILER), suncc)
CC=cc
CFLAGS=-v -xO3
endif
OBJS += sys_sunos.o
LIBS = -lX11 -lkstat -lm
endif
all: wmbubble
wmbubble: $(OBJS)
$(CC) $(LDFLAGS) -o wmbubble $(OBJS) $(LIBS)
bubblemon.o: bubblemon.c wmx11pixmap.h include/bubblemon.h \
include/sys_include.h include/numbers-2.h include/ducks.h \
include/digits.h misc/numbers.xpm misc/ofmspct.xpm misc/datefont.xpm
wmx11pixmap.o: wmx11pixmap.c wmx11pixmap.h
sys_%.o: sys_%.c include/bubblemon.h include/sys_include.h
clean:
rm -f wmbubble *.o *.bb* *.gcov gmon.* *.da *~
install: wmbubble wmbubble.1
$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) $(INSTFLAGS) wmbubble $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/share/man/man1
$(INSTALL) -m 644 wmbubble.1 $(DESTDIR)$(PREFIX)/share/man/man1
dist-tar:
git archive -v -9 --prefix=wmbubble-$(VERSION)/ master \
-o ../wmbubble-$(VERSION).tar.gz
dist: dist-tar
dist-debian: ../wmbubble-$(VERSION).tar.gz
cp $< ../wmbubble_$(VERSION).orig.tar.gz