-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (30 loc) · 895 Bytes
/
Makefile
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
CGI_NAME= sh-cgi
VERSION= 1.12
CGI_OBJ= cgi-util/cgi-util.o
CGI_INC= cgi-util
CC= gcc
BUILDDATE=$(shell date +'%e %b %Y')
#Comment for debug
OPT= -O2
#unbcomment for debug
#DEBUG= -g
CFLAGS= $(OPT) $(DEBUG) -Wall -I$(CGI_INC)/ -DVERSION=\""$(VERSION)"\" -DBUILDDATE=\""$(BUILDDATE)"\" -DCGI_NAME=\""$(CGI_NAME)"\"
LDFLAGS= $(DEBUG)
HFILES= sh-cgi.h shif.h shhtml.h
CFILES= sh-cgi.c shif.c shhtml.c
TARFILES= $(CFILES) $(HFILES) Makefile README LICENCE background.png background.gif
TARNAME= sh-cgi-$(VERSION).tar
EXE= $(CGI_NAME)
OBJ= sh-cgi.o shif.o shhtml.o $(CGI_OBJ)
.PHONY: all clean tags TAGS
all: $(EXE)
$(EXE): $(OBJ)
$(CC) $(LDFLAGS) $^ -o $@
$(OBJ): $(HFILES)
clean: ; -rm -f core $(EXE) $(OBJ) TAGS *~ $(TARNAME) $(TARNAME).gz
tags: TAGS
TAGS: $(CFILES) $(HFILES)
etags -t $(CFILES) $(HFILES)
tar: $(TARFILES)
tar -cf $(TARNAME) $(TARFILES) cgi-util
gzip $(TARNAME)