-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
36 lines (31 loc) · 949 Bytes
/
makefile
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
ifndef INSTALLROOT
INSTALLROOT=${HOME}
endif
SOURCES=d_run.c dictionary.h dictionary.c makefile
DOCS=d1.txt d2.txt README
DIRS=ht clist
all: d_run
d_run: $(SOURCES)
make clean
if [ ! -d "${INSTALLROOT}/include" ]; then mkdir ${INSTALLROOT}/include; fi
if [ ! -d "${INSTALLROOT}/lib" ]; then mkdir ${INSTALLROOT}/lib; fi
cd clist && make install
cd ht && make install
if [ ! -f "${INSTALLROOT}/include" ]; then /bin/cp dictionary.h ${INSTALLROOT}/include; fi
gcc -g -c -Iht dictionary.c
ar rcs ${INSTALLROOT}/lib/libdictionary.a dictionary.o
gcc -g -Wall $< -o $@ -I${INSTALLROOT}/include -L${INSTALLROOT}/lib \
-ldictionary -lchained_hts -llinked_clists
zip:
/bin/rm -rf p12202749
mkdir p12202749
cp $(SOURCES) $(DOCS) p12202749
cp -r $(DIRS) p12202749
/bin/rm -f p12202749.tar.gz
tar czf p12202749.tar.gz p12202749
/bin/rm -rf p12202749
.PHONY: clean
clean:
/bin/rm -f d_run *.o
cd clist && make clean
cd ht && make clean