File: Makefile.in

package info (click to toggle)
c2html 0.7.2-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 192 kB
  • ctags: 50
  • sloc: ansic: 511; lex: 416; sh: 152; makefile: 131
file content (121 lines) | stat: -rw-r--r-- 3,893 bytes parent folder | download | duplicates (4)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
SHELL = /bin/sh

.SUFFIXES:
# If COMPRESSION is not zero the executable will also work as
# a CGI-script. The number you specify will be passed to gzip
# as compression mode, if your browser can unzip it.
#
# It is recommended to use a not so high compression mode
# for gzip because otherwise the load on the web server
# grows without having big benefits.
# COMPRESSION = -DCOMPRESSION=4
COMPRESSION = -DCOMPRESSION=1

# Dont change things beyond this line.
TARGET          = @PROJECT_NAME@
VERSION         = @VERSION@
SRCS            = @srcdir@/mymain.c @srcdir@/colors.c
HDRS            = @srcdir@/colors.h @srcdir@/mymain.h 
LEXSRCS         = @srcdir@/$(TARGET).l
CONFIGS         = ./config.status Makefile config.h
MANPAGE	        = $(TARGET).1
LSM             = $(TARGET).lsm
DOCS            = AUTHORS COPYING NEWS README $(MANPAGE) $(LSM)
CONFIGIN        = Makefile.in configure.in configure install-sh config.h.in
TMPCONFIGFILES  = config.cache config.status config.log config.h
FILENAME        = $(TARGET)-$(VERSION)

CC              = @CC@
LEX             = @LEX@
LEXLIB          = @LEXLIB@
LEXOUTPUT       = @LEX_OUTPUT_ROOT@.c
INSTALL         = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA    = @INSTALL_DATA@
prefix          = /usr/local
exec_prefix     = ${prefix}
bindir          = @bindir@
mandir          = @mandir@
man1dir         = @mandir@/man1
srcdir          = @srcdir@
CPPFLAGS        = @CPPFLAGS@

CFLAGS += -O2 -Wall
ALL_CFLAGS = $(CFLAGS) -I$(srcdir) $(COMPRESSION) 

all: $(TARGET)

$(TARGET): $(CONFIGIN) $(CONFIGS) $(LEXOUTPUT) $(SRCS) $(HDRS) 
	$(CC) $(ALL_CFLAGS) -o $(TARGET) $(LEXOUTPUT) $(SRCS) $(LEXLIB)

$(LEXOUTPUT): $(CONFIGS) $(LEXSRCS) $(HDRS)
	$(LEX) $(LEXSRCS)

install: $(TARGET)
	@echo "Installing" $(TARGET) "to" $(bindir)
	-mkdir -p $(bindir) $(man1dir)
	$(INSTALL_PROGRAM) $(TARGET) $(bindir)/$(TARGET)
	$(INSTALL_DATA) $(srcdir)/$(MANPAGE) $(man1dir)/$(MANPAGE)

install-strip: $(TARGET)
	@echo "Installing" $(TARGET) "to" $(bindir)
	-mkdir -p $(bindir) $(man1dir)
	$(INSTALL_PROGRAM) -s $(TARGET) $(bindir)/$(TARGET)
	$(INSTALL_DATA) $(srcdir)/$(MANPAGE) $(man1dir)/$(MANPAGE)

uninstall:
	rm $(bindir)/$(TARGET)
	rm $(man1dir)/$(MANPAGE)

clean:
	rm -rf *.o *~ $(LEXOUTPUT) TAGS

distclean:
	rm -rf *.o *~ Makefile $(LEXOUTPUT) $(TARGET) $(TMPCONFIGFILES) TAGS

# stuff to update Makefile when changing configuration

$(srcdir)/configure: $(srcdir)/configure.in
	cd $(srcdir) && autoconf

Makefile: $(srcdir)/Makefile.in $(srcdir)/config.h.in
	@echo "regeneration with (in ./config.status) saved configure results..."
	./config.status
	@echo
	@echo Please rerun make so it will use the updated Makefile.
	exit 1

./config.status: $(srcdir)/configure
	$(srcdir)/configure
	@echo
	@echo Please rerun make so it will use the updated Makefile.
	exit 1

# stuff to create a distribution
# also updates the .lsm file with version and size of archive
dist: $(CONFIGIN) $(CONFIGS) $(LEXSRCS) $(SRCS) $(HDRS) $(DOCS)
#	@echo This only works if you have not changed
#	@echo the version number directly before.
#	@echo If so, start a make without parameters first.
	@echo
	@echo Will create
	@echo $(FILENAME).tar.gz
	@echo
	@echo 'Type CTRL-C to abort (you have 5 seconds)!'
	@sleep 5  
	@echo "updating" $(TARGET).lsm
	@rm -rf $(FILENAME)
	@mkdir $(FILENAME)
	@cp $(LEXSRCS) $(SRCS) $(HDRS) $(DOCS) $(CONFIGIN) $(FILENAME)
	@tar -czf $(FILENAME).tar.gz $(FILENAME)
	@sed -e "s/^Version:.*/Version:        $(VERSION)/" \
	    -e "s/^Entered-date:.*/Entered-date:   `date \
			'+%d%b%y' | tr '[a-z]' '[A-Z]'`/" \
	    -e "s/$(TARGET)-.*.tar.gz/$(FILENAME).tar.gz/" \
	    -e "s/[0-9]*kB $(FILENAME).tar.gz/`du \
		 -k $(FILENAME).tar.gz\
		  | cut -f1`kB $(FILENAME).tar.gz/" \
	    < $(TARGET).lsm > $(FILENAME)/$(TARGET).lsm
	@cp $(FILENAME)/$(TARGET).lsm .
	@echo "creating" $(FILENAME).tar.gz
	@tar -czf $(FILENAME).tar.gz $(FILENAME)