File: Makefile

package info (click to toggle)
dbf2mysql 1.14a-5
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 320 kB
  • sloc: ansic: 4,680; makefile: 147
file content (104 lines) | stat: -rw-r--r-- 2,928 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
# Makefile for the dbf2mysql-utility
# Maarten Boekhold (boekhold@cindy.et.tudelft.nl) 1995

# Set this to your C-compiler
#CC=gcc

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# set this to your install-program (what does Solaris have
# in /usr/sbin/install? SYSV install?)
INSTALL=/usr/bin/install

#AR=/usr/bin/ar
#AR=ar

# Set this to whatever your compiler accepts. Nothing special is needed
#CFLAGS=-g -Wall -pedantic -include /usr/include/mpatrol.h
#CFLAGS=-g -Wall
CFLAGS+=-O2 -Wall

# Set this to make smaller binaries
STRIP=
#STRIP=-s

# Set this to your MySQL installation-path
MYSQLINC=-I/usr/include/mysql
MYSQLLIB=

# Set this to where you want the binary (no man-page yet, don't know
# how to write them)
INSTALLDIR=$(DESTDIR)/usr/bin

# Set this if your system needs extra libraries
#
# For Solaris use:
#EXTRALIBS= -lmysys -lmystrings -lmysqlclient  -lm
# For mpatrol use (see http://www.cbmamiga.demon.co.uk/mpatrol/)
#EXTRALIBS= -lmpatrol -lbfd -liberty -lmysqlclient -lm
EXTRALIBS= -lmysqlclient -lm

# You should not have to change this unless your system doesn't have gzip
# or doesn't have it in the standard place (/usr/local/bin for ex.).
# Anyways, it is not needed for just a simple compile and install
RM=/bin/rm -f
GZIP=/bin/gzip
TAR=/bin/tar
BZIP2=/usr/bin/bzip2

VERSION=1.14

OBJS=dbf.o endian.o libdbf.a dbf2mysql.o mysql2dbf.o

all: dbf2mysql mysql2dbf

libdbf.a: dbf.o endian.o
	$(AR) rcs libdbf.a dbf.o endian.o

dbf2mysql: dbf2mysql.o libdbf.a
	$(CC) $(CFLAGS) $(STRIP) -L. $(MYSQLLIB) -o $@ dbf2mysql.o -ldbf \
		$(EXTRALIBS) $(LDFLAGS)

mysql2dbf: mysql2dbf.o libdbf.a
	$(CC) $(CFLAGS) $(STRIP) -L. $(MYSQLLIB) -o $@ mysql2dbf.o -ldbf \
		$(EXTRALIBS) $(LDFLAGS)

dbf.o: dbf.c dbf.h
	$(CC) $(CFLAGS) -c -o $@ dbf.c

endian.o: endian.c
	$(CC) $(CFLAGS) -c -o $@ endian.c

dbf2mysql.o: dbf2mysql.c dbf.h
	$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" $(MYSQLINC) -c -o $@ dbf2mysql.c

mysql2dbf.o: mysql2dbf.c dbf.h
	$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" $(MYSQLINC) -c -o $@ mysql2dbf.c

install: dbf2mysql
	$(INSTALL) -d -m 0755 $(INSTALLDIR)
	$(INSTALL) -m 0755 dbf2mysql $(INSTALLDIR)
	$(INSTALL) -m 0755 mysql2dbf $(INSTALLDIR)

clean:
	$(RM) $(OBJS) dbf2mysql mysql2dbf

# the 'expand' is just for me, I use a tabstop of 4 for my editor, which
# makes lines in the README very long and ugly for people using 8, so
# I just expand them to spaces

dist:
#	-expand -4 README.tab > README
	(cd .. ; $(TAR) cf dbf2mysql-$(VERSION).tar dbf2mysql-$(VERSION)/*.[ch] \
	dbf2mysql-$(VERSION)/Makefile dbf2mysql-$(VERSION)/README \
        dbf2mysql-$(VERSION)/kbl2win.cvt ; \
	$(GZIP) -f9 dbf2mysql-$(VERSION).tar)

distbz2:
#	-expand -4 README.tab > README
	(cd .. ; $(TAR) cf dbf2mysql-$(VERSION).tar dbf2mysql-$(VERSION)/*.[ch] \
	dbf2mysql-$(VERSION)/Makefile dbf2mysql-$(VERSION)/README \
        dbf2mysql-$(VERSION)/kbl2win.cvt ; \
	$(BZIP2) dbf2mysql-$(VERSION).tar)