File: Makefile

package info (click to toggle)
shc 3.7-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 208 kB
  • ctags: 104
  • sloc: ansic: 1,121; makefile: 93; sh: 28; sed: 12; csh: 2
file content (75 lines) | stat: -rw-r--r-- 1,564 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
# Makefile
#

INSTALL_PATH = /usr/local

# For SCO
CFLAGS = -b elf -O -D_SVID

# For IRIX
CFLAGS = -xansi -fullwarn -O3 -g0

# For Solaris
CFLAGS = -fast -xO4 -s -v -Xa

# For HPUX
CFLAGS = -Wall -O -Ae

# For OSF1
CFLAGS = -w -verbose -fast -std1 -g0

# For GNU C compiler
CFLAGS = -Wall -O6 -pedantic

SHELL = /bin/sh

all: shc ask_for_test

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

ask_for_test:
	@echo '***	Do you want to probe shc with a test script?'
	@echo '***	Please try...	make test'

test: make_the_test ask_for_strings

make_the_test: match.x
	@echo '***	Running a compiled test script!'
	@echo '***	It must show files with substring "sh" in your PATH...'
	./match.x sh

match.x: match.x.c
	$(CC) $(CFLAGS) $< -o $@

match.x.c: shc match
	@echo '***	Compiling script "match"'
	CFLAGS="$(CFLAGS)" ./shc -v -r -f match

ask_for_strings:
	@echo '***	Do you want to see strings in the generated binary?'
	@echo '***	Please try...	make strings'

strings: make_the_strings ask_for_install

make_the_strings: match.x
	@echo '***	Running: "strings -n 5 '$<'"'
	@echo '***	It must show no sensible information...'
	strings -n 5 $<

ask_for_install:
	@echo '***	Do you want to install shc?'
	@echo '***	Please try...	make install'

install: shc
	@echo '***	Installing shc and shc.1 on '$(INSTALL_PATH)
	@echo -n '***	Do you want to continue? '; read ANS; case "$$ANS" in y|Y|yes|Yes|YES) ;; *) exit 1;; esac;
	install -c -s shc $(INSTALL_PATH)/bin/
	install -c -m 644 shc.1 $(INSTALL_PATH)/man/man3/

clean:
	rm -f *.o *~ *.x.c

cleanall: clean
	rm -f shc *.x