/[gentoo-alt]/trunk/baselayout-prefix/src/Makefile
Gentoo

Contents of /trunk/baselayout-prefix/src/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1708 - (show annotations) (download)
Sun May 1 19:16:25 2011 UTC (3 years, 7 months ago) by grobian
File size: 1071 byte(s)
buildsys: make OS conditional code functional
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 CC = gcc
5 LD = gcc
6
7 CFLAGS ?= -Wall -O2
8 DESTDIR =
9 LIBDIR = lib
10
11 BIN_TARGETS =
12 SBIN_TARGETS = consoletype runscript start-stop-daemon
13 SYS_WHITELIST = env_whitelist
14
15 TARGET = $(BIN_TARGETS) $(SBIN_TARGETS)
16
17 OS = $(shell uname)
18 ifeq ($(OS),Linux)
19 LDFLAGS_RS = -ldl
20 endif
21 ifeq ($(OS),BSD)
22 LDFLAGS_SSD = -lkvm
23 endif
24
25 override CFLAGS += -DLIBDIR=\"$(LIBDIR)\"
26
27 all: $(TARGET)
28
29 rs-misc.o: core/misc.c
30 $(CC) $(CFLAGS) -c -o $@ $^
31
32 runscript: runscript.o rs-misc.o
33 $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS_RS)
34
35 start-stop-daemon: start-stop-daemon.c
36 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS_SSD)
37
38 install: $(TARGET)
39 install -m 0755 -d $(DESTDIR)/bin
40 install -m 0755 -d $(DESTDIR)/sbin
41 # install -m 0755 $(BIN_TARGETS) $(DESTDIR)/bin
42 install -m 0755 $(SBIN_TARGETS) $(DESTDIR)/sbin
43 install -m 0755 -d $(DESTDIR)/$(LIBDIR)/rcscripts/conf.d
44 install -m 0644 $(SYS_WHITELIST) $(DESTDIR)/$(LIBDIR)/rcscripts/conf.d
45
46 clean:
47 rm -f $(TARGET)
48 rm -f *.o *~

  ViewVC Help
Powered by ViewVC 1.1.20