blob: 5601d93aca6d0554825a5c124f342c90568e3fee (
plain)
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
|
PREFIX?= /usr/local
CC?= gcc
CXX?= g++
CFLAGS+= -I. -O -Wimplicit -Wreturn-type -Wswitch \
-Wcomment -Wformat -Wchar-subscripts \
-Wparentheses -Wpointer-arith -Wcast-qual \
-Woverloaded-virtual -static
CXXFLAGS+= ${CFLAGS} -Wno-deprecated
LIBS= -lm -lstdc++
LDADD+= ${LIBS}
PROG= gds2gdt gdt2gds
SRCS.gds2gdt= sRemoveTrailingZeros.C get_field.c stoupper.c sfind.C \
match_string.C sRemoveSpaces.C sRemoveWhiteSpace.C \
mystrncpy.C gdsStream.C gds2gdt.C
.for P in ${PROG}
OBJS.${P}= ${SRCS.${P}:N*.h:R:S,$,.o,g}
.endfor
SRCS.gdt2gds= sRemoveWhiteSpace.C sRemoveTrailingZeros.C \
get_field.c stoupper.c sfind.C match_string.C \
sRemoveSpaces.C mystrncpy.C gdsStream.C gdt2gds.C
BSD_INSTALL_PROGRAM?= install -s -m 555
all: ${PROG}
clean:
rm -f *.o ${PROG}
install:
${BSD_INSTALL_PROGRAM} ${PROG} ${DESTDIR}${PREFIX}/bin
.for P in ${PROG}
${P}: ${OBJS.${P}}
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS.${P}} ${LDADD}
.endfor
.for F in ${SRCS:M*.C}
${F:R:S,$,.o,g}: ${F}
${CC} ${CFLAGS} -c -o ${.TARGET} ${F}
.endfor
.for F in ${SRCS:M*.c}
${F:R:S,$,.o,g}: ${F}
${CXX} ${CXXFLAGS} -c -o ${.TARGET} ${F}
.endfor
|