File: Makefile

package info (click to toggle)
startpar 0.64-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 224 kB
  • sloc: ansic: 2,061; makefile: 87; sh: 59; cpp: 16
file content (96 lines) | stat: -rw-r--r-- 2,102 bytes parent folder | download
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
VERSION = 0.64
PACKAGE=startpar
PROJECT=sysvinit
#ISSUSE	= -DSUSE

INSTALL		= install -m 755
INSTALL_DATA	= install -m 644
DESTDIR		=
sbindir		= /bin
mandir		= /usr/share/man
man1dir		= $(mandir)/man1

SRCS		= startpar.c makeboot.c proc.c
CXXSRCS         = compiletest.cc
HDRS		= makeboot.h proc.h
REST		= COPYING Makefile startpar.1
OBJS		= $(SRCS:.c=.o) $(CXXSRCS:.cc=.o)
OPT		?= -O2

STARTPAR        := $(shell pwd)/startpar
TARBALL	        = $(PACKAGE)-$(VERSION).tar.xz

ifneq ($(INC),)
    LIBS	+= -lblogger
    COPTS	+= -DUSE_BLOGD
endif

CC     ?= gcc
CFLAGS = $(RPM_OPT_FLAGS) $(COPTS) -D_GNU_SOURCE $(INC) -pipe $(OPT)

WARNINGS = -Wall -W -Wformat -Werror=format-security
CFLAGS += $(WARNINGS)

# Enable large file support on GNU/Hurd
CFLAGS += $(shell getconf LFS_CFLAGS)

CPPFLAGS += $(EXTRACPPFLAGS)
CFLAGS += $(EXTRACFLAGS)
LDFLAGS += $(EXTRALDFLAGS)

CPPFLAGS += $(EXTRACPPFLAGS)
CFLAGS += $(EXTRACFLAGS)
LDFLAGS += $(EXTRALDFLAGS)

ifeq ($(MAKECMDGOALS),makeboot)
CFLAGS += -DTEST
endif

SOURCEFILES= compiletest.cc \
	     CHANGELOG \
             COPYING \
             makeboot.c \
             makeboot.h \
             Makefile \
             proc.c \
             proc.h \
             README \
             startpar.1 \
             startpar.c


.c.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) -DVERSION=\"$(VERSION)\" $(ISSUSE) -c $<

all: startpar
startpar: $(OBJS)
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DVERSION=\"$(VERSION)\" $(ISSUSE) -o $@ $(OBJS) $(LIBS)

makeboot: makeboot.c

install: startpar
	$(INSTALL) -d $(DESTDIR)$(sbindir) $(DESTDIR)$(man1dir)
	$(INSTALL) startpar $(DESTDIR)$(sbindir)/.
	$(INSTALL_DATA) startpar.1 $(DESTDIR)$(man1dir)/.

check: all
	$(MAKE) STARTPAR=$(STARTPAR) -C testsuite $@

distclean: clean
	rm -f $(TARBALL) $(TARBALL).sig

clean:
	rm -f startpar makeboot $(OBJS)


dist: $(TARBALL).sig

$(TARBALL).sig: $(TARBALL)
	@gpg -q -ba --use-agent -o $@ $<

$(TARBALL): clean
	mkdir -p startpar/testsuite
	cp $(SOURCEFILES) startpar/
	cp testsuite/* startpar/testsuite/
	@tar --xz --owner=nobody --group=nogroup -cf $(TARBALL) startpar/
	rm -rf startpar/