summaryrefslogtreecommitdiff
path: root/support/charconv/Makefile
blob: bf318599ca3d9e9d2de477d94399d05ad0287fca (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
50
51
52
# Makefile for charconv
BIN_DIR = /usr/local/bin
#MAN_DIR = /usr/local/man
MAN_DIR = /usr/man
MANEXT = 1
#
SHELL=/bin/sh
CC= cc
#CC= gcc
CFLAGS= -O

LFLAGS=

CFILES= charconv.c getopt.c
OFILES= charconv.o getopt.o

CFILES2= char_arr.c getopt.c
OFILES2= char_arr.o getopt.o

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

charconv: $(OFILES)
	$(CC) $(CFLAGS) -o charconv $(OFILES) $(LFLAGS)

char_arr: $(OFILES2)
	$(CC) $(CFLAGS) -o char_arr $(OFILES2) $(LFLAGS)

charconv.o: charconv.c charstab.h sys_def.h

char_arr.o: char_arr.c charstab.h sys_def.h

getopt.o: sys_def.h

install: charconv
	-if [ ! -d $(BIN_DIR) ] ; then mkdir -p $(BIN_DIR); fi
	strip charconv
	cp charconv $(BIN_DIR)

install.man: charconv.man
	-if [ ! -d $(MAN_DIR) ] ; then mkdir -p $(MAN_DIR); fi
	-if [ ! -d $(MAN_DIR)/man$(MANEXT) ]; \
	  then mkdir -p $(MAN_DIR)/man$(MANEXT); fi
	cp charconv.man $(MAN_DIR)/man$(MANEXT)/charconv.$(MANEXT)

clean:
	rm -f *.o charconv char_arr

dist:
	rm -f *.o charconv char_arr
	cd .. ; tar cvf charconv.tar ./charconv ; compress charconv.tar ; \
	  cd charconv