File: Makefile

package info (click to toggle)
sash 3.8-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 768 kB
  • sloc: ansic: 8,177; makefile: 47; sh: 10
file content (73 lines) | stat: -rw-r--r-- 2,054 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
#
# Makefile for sash
#
# The HAVE_GZIP definition adds the -gzip and -gunzip commands.
# The HAVE_LINUX_ATTR definition adds the -chattr and -lsattr commands.
# The HAVE_LINUX_CHROOT definition adds the -chroot command.
# The HAVE_LINUX_PIVOT definition adds the -pivot_root command.
# The HAVE_LINUX_LOSETUP definition adds the -losetup command.
# The HAVE_LINUX_MOUNT definition makes -mount and -umount work on Linux.
# The HAVE_BSD_MOUNT definition makes -mount and -umount work on BSD.
# The MOUNT_TYPE definition sets the default file system type for -mount.
#
# Note that the linker may show warnings about 'statically linked
# programs' requiring getpwnam, getpwuid, getgrnam and getgrgid.
# This is unavoidable since those routines use dynamic libraries anyway.
# Sash will still run, but if there are shared library problems then
# the user might have to be be careful when using the -chown, -chgrp,
# and -ls commands.
#

HAVE_GZIP		= 1
HAVE_LINUX_ATTR		= 1
HAVE_LINUX_CHROOT	= 1
HAVE_LINUX_LOSETUP	= 1
HAVE_LINUX_PIVOT	= 1
HAVE_LINUX_MOUNT	= 1
HAVE_LINUX_RAID		= 1
HAVE_BSD_MOUNT		= 0
MOUNT_TYPE		= '"ext4"'

CFLAGS ?= -O3 -Wall -Wmissing-prototypes

DEFS = \
	-DHAVE_GZIP=$(HAVE_GZIP) \
	-DHAVE_LINUX_ATTR=$(HAVE_LINUX_ATTR) \
 	-DHAVE_LINUX_CHROOT=$(HAVE_LINUX_CHROOT) \
 	-DHAVE_LINUX_LOSETUP=$(HAVE_LINUX_LOSETUP) \
 	-DHAVE_LINUX_PIVOT=$(HAVE_LINUX_PIVOT) \
	-DHAVE_LINUX_MOUNT=$(HAVE_LINUX_MOUNT) \
	-DHAVE_LINUX_RAID=$(HAVE_LINUX_RAID) \
	-DHAVE_BSD_MOUNT=$(HAVE_BSD_MOUNT) \
	-DMOUNT_TYPE=$(MOUNT_TYPE)

CPPFLAGS += $(DEFS)

LDFLAGS += -static
LIBS = -lz


DESTDIR =
BINDIR = /usr/bin
MANDIR = /usr/share/man


OBJS = sash.o cmds.o cmd_dd.o cmd_ed.o cmd_grep.o cmd_ls.o cmd_tar.o \
       linenoise.o encodings/utf8.o \
	cmd_gzip.o cmd_find.o cmd_file.o cmd_chattr.o cmd_ar.o utils.o


sash:	$(OBJS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)

clean:
	rm -f $(OBJS) sash

install: sash
	cp sash $(DESTDIR)$(BINDIR)/sash
	cp sash.1 $(DESTDIR)$(MANDIR)/man1/sash.1

%.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<

$(OBJS):	sash.h