File: Makefile

package info (click to toggle)
makeztxt 1.60-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 240 kB
  • ctags: 191
  • sloc: ansic: 1,956; makefile: 176; sh: 3
file content (161 lines) | stat: -rw-r--r-- 4,354 bytes parent folder | download | duplicates (2)
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
###############################################################################
# Makefile for makeztxt
#
# $Id: Makefile,v 1.26 2003/08/12 10:44:59 foxamemnon Exp $
###############################################################################

VERSION	= 1.60

LIBS	= -lztxt
INCLUDE	= -I../common -I.

CC	= gcc
CFLAGS	= -Wall -O2 -pipe $(INCLUDE)
# GNU make is mandatory
#MAKE	= make


######################################
#####    Compilation  Options    #####
#####   Change for your system   #####
######################################

# Turns on -fpack-struct which some systems need to properly handle the
# packed structs in Palm DB headers.
# If you're compiling on a Sun (with gcc), you'll need this.
#PACK = 1

# By default, libztxt will use GNU regex.  This is good because they are
# more featureful and faster (on large strings) than POSIX regex.
# But... maybe you don't have GNU regex.
# In particular, if compiling with Cygwin, you need this.
#USEPOSIX = 1

# DOS, in all its infinite wisdom, decided long ago to differentiate between
# text files and binary files.  Text files get their \n converted to \r\n and
# vice-versa.  This is bad and stupid.  DOS is bad and stupid.  Uncomment
# this line if compiling for DOS (or any platform which makes the above
# distinction).  Specifically, this makes files opens used the O_BINARY flag.
#HAVEBINARYFLAG = 1

# Cygwin binaries need an additional library for regex to function.  Also, to
# avoid extra DLL dependencies, we statically link against libz.a.
#CYGWINLIBS = 1

# If you're on a system that does not have getopt.h or does not have the
# getopt_long() function, comment this out.  Regular getopt() will be used.
LONG_OPTS = 1


#####################################
#####  End user config section  #####
#####################################



SRC	= makeztxt.c
OBJS	= $(SRC:.c=.o)

DISTFILES  = $(SRC) ../common/weasel_common.h \
	     Makefile ChangeLog ../COPYING README .makeztxtrc

BINFILES   = makeztxt ChangeLog ../COPYING README .makeztxtrc


ifeq ($(PACK),1)
	CFLAGS += -fpack-struct
endif

ifeq ($(USEPOSIX),1)
	CFLAGS += -DPOSIX_REGEX
endif

ifneq ($(HAVEBINARYFLAG),1)
	CFLAGS += -DO_BINARY=0
endif

ifeq ($(CYGWINLIBS),1)
	LIBS += /lib/libz.a /lib/libregex.a
else
	LIBS += -lz
endif

ifeq ($(LONG_OPTS),1)
	CFLAGS += -DLONG_OPTS=1
endif




all: makeztxt

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

makeztxt: $(OBJS) libztxt/libztxt.a libztxt/ztxt.h
	$(CC) -Llibztxt -o makeztxt $(OBJS) $(LIBS)

libztxt/libztxt.a::
	$(MAKE) -C libztxt CC=$(CC) USEPOSIX=$(USEPOSIX) PACK=$(PACK) all

# Cleaning and Makefile maintainence
clean:
	$(MAKE) -C libztxt clean
	-rm -f *.o *~

distclean: clean
	-rm -f makeztxt

depends:
	makedepend -Y. $(INCLUDE) $(SRC)



# The GPL makes a good test database
gpl.pdb:
	./makeztxt -l -t "GNU General Public License" -r Preamble -r "TERMS AND CONDITIONS FOR COPYING" -r "  NO WARRANTY" -r "END OF TERMS AND CONDITIONS" ../COPYING
	mv COPYING.pdb ../pdb/GPL.pdb



# This makes it much easier for me to make distributions
alldist: dist dist-zip dist-bin dist-bin-zip

dist:
	mkdir makeztxt-$(VERSION)
	mkdir makeztxt-$(VERSION)/libztxt
	cp $(DISTFILES) makeztxt-$(VERSION)
	cp libztxt/*.c makeztxt-$(VERSION)/libztxt
	cp libztxt/*.h makeztxt-$(VERSION)/libztxt
	cp libztxt/Makefile makeztxt-$(VERSION)/libztxt
	cp libztxt/buildcounter makeztxt-$(VERSION)/libztxt
	cp libztxt/inc_bcounter.sh makeztxt-$(VERSION)/libztxt
	tar czf makeztxt-$(VERSION)-src.tar.gz makeztxt-$(VERSION)
	rm -rf makeztxt-$(VERSION)

dist-zip:
	mkdir makeztxt-$(VERSION)
	mkdir makeztxt-$(VERSION)/libztxt
	cp $(DISTFILES) makeztxt-$(VERSION)
	cp libztxt/*.c makeztxt-$(VERSION)/libztxt
	cp libztxt/*.h makeztxt-$(VERSION)/libztxt
	cp libztxt/Makefile makeztxt-$(VERSION)/libztxt
	cp libztxt/buildcounter makeztxt-$(VERSION)/libztxt
	cp libztxt/inc_bcounter.sh makeztxt-$(VERSION)/libztxt
	-cd makeztxt-$(VERSION) ; flip -m *
	zip -9r makeztxt-$(VERSION)-src.zip makeztxt-$(VERSION)
	rm -rf makeztxt-$(VERSION)

dist-bin:
	mkdir makeztxt-$(VERSION)
	cp $(BINFILES) makeztxt-$(VERSION)
	tar czf makeztxt-$(VERSION).i386.tar.gz makeztxt-$(VERSION)
	rm -rf makeztxt-$(VERSION)

dist-bin-zip:
	mkdir makeztxt-$(VERSION)
	cp $(BINFILES) makeztxt-$(VERSION)
	-cd makeztxt-$(VERSION) ; flip -m *
	zip -9r makeztxt-$(VERSION).i386.zip makeztxt-$(VERSION)
	rm -rf makeztxt-$(VERSION)