File: Makefile

package info (click to toggle)
lsh 0.70-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 476 kB
  • ctags: 302
  • sloc: ansic: 6,713; makefile: 69; sh: 15
file content (82 lines) | stat: -rw-r--r-- 2,728 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
# Makefile for the lsh shell

# If you do not want to use the termcap library, 
# just delete the -DUSE_TERMCAP (and -ltermcap) and do a 
# make clean ; make
CC     = gcc
CFLAGS = -Wall -O2 -fomit-frame-pointer
#LIBS   = -ltermcap

# The object files.
OBJ    = inp.o built.o parse.o map.o lex.o misc.o prompt.o exp.o alias.o main.o 

# Compile the shell (link the modules).
lsh: $(OBJ)
	$(CC) $(CFLAGS) $(OBJ) -o lsh $(LIBS)
	-strip lsh

# Install the shell on you system (has to be done as root). This section
# requires cp, chmod, chown and would benefit from dialog, the groff 
# suite of programs, gzip, GNU install and echo.
install: lsh # <-delete this <lsh> if you do NOT want to recompile 
#	-@dialog --title "LSH Installation" --infobox "Installing Executable : \nlsh -> /bin/lsh" 4 50
#	@cp     lsh      /bin/lsh
#	@chown  root.bin /bin/lsh 
#	@chmod  755      /bin/lsh
#	-@dialog --title "LSH Installation" --infobox "Installing Configuration File : \nsample.etc.autoexec -> /etc/autoexec" 4 50
#	@cp    sample.etc.autoexec /etc/autoexec
#	@chown root.root           /etc/autoexec
#	@chmod 644                 /etc/autoexec
#	-@dialog --title "LSH Installation" --infobox "Installing Manual Page :\n/usr/man/man1/lsh" 4 50
#	-@install -d     /usr/man/man1
#	@cp    lsh.1     /usr/man/man1
#	@chown root.root /usr/man/man1/lsh.1
#	@chmod 644       /usr/man/man1/lsh.1
#	-@dialog --title "LSH Installation" --infobox "Preformatting Manual Page : \n/usr/man/preformat/cat1/lsh.1.gz" 4 50
#	-@install -d     /usr/man/preformat/cat1
#	-@groff -s -p -t -e -Tascii -mandoc lsh.1 | gzip -9 > /usr/man/preformat/cat1/lsh.1.gz
#	-@chown root.man /usr/man/preformat/cat1/lsh.1.gz
#	-@chmod 644      /usr/man/preformat/cat1/lsh.1.gz
#	-@dialog --title "Installation Complete" --infobox "Remember to add a /bin/lsh\nentry to the /etc/shells file\nif your chsh or ftpd require that.\n\nFor a quick start try typing :\nlsh -k /etc/autoexec" 8 50
#	-@echo -e "\nDone !\a\n"

# Quiet install. Does not preformat page.
quiet: lsh # <-delete this <lsh> if you do NOT want to recompile 
	install -s lsh $(DESTDIR)/usr/bin/lsh
	install -m 644 sample.etc.autoexec $(DESTDIR)/etc/autoexec
#	install -m 644 lsh.1 $(DESTDIR)/usr/man/man1

# Compile the modules.
main.o: main.c
	$(CC) $(CFLAGS) -c main.c

inp.o: inp.c
	$(CC) $(CFLAGS) -c inp.c

lex.o: lex.c
	$(CC) $(CFLAGS) -c lex.c

map.o: map.c
	$(CC) $(CFLAGS) -c map.c

alias.o: alias.c
	$(CC) $(CFLAGS) -c alias.c

misc.o: misc.c
	$(CC) $(CFLAGS) -c misc.c

built.o: built.c
	$(CC) $(CFLAGS) -c built.c

parse.o: parse.c
	$(CC) $(CFLAGS) -c parse.c

exp.o: exp.c
	$(CC) $(CFLAGS) -c exp.c

prompt.o: prompt.c
	$(CC) $(CFLAGS) -c prompt.c

# Delete the object files.
clean: 
	-rm -f *.o