summaryrefslogtreecommitdiff
path: root/package/mopd/src/mopchk/Makefile
blob: 3aef3c10cf794c4af3c25d006b07aa8d6448a3fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
OBJS=mopchk.o
INCL=-I../ -I../common
LIBS=../common/libcommon.a

all: mopchk

mopchk: ${OBJS} version.o $(LIBS)
	$(CC) -o mopchk version.o ${OBJS} ${LIBS}

.c.o: .c
	$(CC) -c $(CFLAGS) ${INCL} $<
	
clean:
	rm -f *.o *~ mopchk VERSION version.*
	
version.o: version.c
version.c version.h: 
	ln -sf ../common/VERSION VERSION
	rm -f version.c ; sed 's/.*/char version[] = "&";/' VERSION > version.c
	set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' VERSION` ; \
		{ echo '#define VERSION_MAJOR' $$1 ; \
		  echo '#define VERSION_MINOR' $$2 ; } > version.h