File: Makefile

package info (click to toggle)
sash 3.7-12
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 556 kB
  • sloc: ansic: 12,378; makefile: 97; sh: 27
file content (56 lines) | stat: -rw-r--r-- 1,298 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
#
# 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_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.
#
HAVE_GZIP		= 1
ifeq (Linux,$(shell uname -s))
HAVE_LINUX_ATTR		= 1
HAVE_LINUX_MOUNT	= 1
HAVE_BSD_MOUNT		= 0
MOUNT_TYPE		= '"ext3"'
endif
ifeq (GNU/kFreeBSD,$(shell uname -s))
HAVE_LINUX_ATTR	= 0
HAVE_LINUX_MOUNT	= 0
HAVE_BSD_MOUNT		= 1
MOUNT_TYPE		= '"ufs"'
endif

DEFS = -DHAVE_GZIP=$(HAVE_GZIP) \
	-DHAVE_LINUX_ATTR=$(HAVE_LINUX_ATTR) \
	-DHAVE_LINUX_MOUNT=$(HAVE_LINUX_MOUNT) \
	-DHAVE_BSD_MOUNT=$(HAVE_BSD_MOUNT) \
	-DMOUNT_TYPE=$(MOUNT_TYPE)
CFLAGS = -O3 -Wall -Wmissing-prototypes -g $(DEFS)

LDFLAGS = -static -s
LIBS = -lz


BINDIR = /bin
MANDIR = /usr/man/man1


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


sash:	$(OBJS)
	$(CC) $(LDFLAGS) -o sash $(OBJS) $(LIBS)

clean:
	rm -f $(OBJS) sash

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

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

$(OBJS):	sash.h