File: Makefile

package info (click to toggle)
dbeacon 0.3.9.3-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 304 kB
  • ctags: 538
  • sloc: cpp: 2,345; perl: 1,549; sh: 68; makefile: 40
file content (50 lines) | stat: -rw-r--r-- 992 bytes parent folder | download | duplicates (2)
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
CXX ?= g++
CXX_SUN = $(shell $(CXX) -V 2>&1 | grep 'Sun C++' >/dev/null && echo yes)
ifeq ($(CXX_SUN),yes)
	CXXFLAGS += -g -xs
else
	CXXFLAGS += -g -Wall -O2 -fno-strict-aliasing
endif

PREFIX ?= /usr/local

OBJS = dbeacon.o dbeacon_posix.o protocol.o ssmping.o

OS = $(shell uname -s)

ifeq ($(OS), SunOS)
	CXXFLAGS += -DSOLARIS
	ifeq ($(CXX_SUN), yes)
		CXXFLAGS += -D_XPG4_2 -D__EXTENSIONS__
	endif
	LDFLAGS = -lnsl -lsocket
endif

all: dbeacon

dbeacon: $(OBJS)
	$(CXX) $(CXXFLAGS) -o dbeacon $(OBJS) $(LDFLAGS)

dbeacon.o: dbeacon.cpp dbeacon.h address.h msocket.h protocol.h

dbeacon.h: address.h

msocket.h: address.h

protocol.h: address.h

dbeacon_posix.o: dbeacon_posix.cpp dbeacon.h msocket.h address.h

protocol.o: protocol.cpp dbeacon.h protocol.h

ssmping.o: dbeacon.h address.h msocket.h

install: dbeacon
	install -D dbeacon $(DESTDIR)$(PREFIX)/bin/dbeacon

install_mans:
	install -D docs/dbeacon.1 $(DESTDIR)$(PREFIX)/share/man/man1/dbeacon.1

clean:
	rm -f dbeacon $(OBJS)