Skip to content

Commit

Permalink
Added uninstall option to the makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
pranomostro committed Oct 11, 2016
1 parent 9ec43ac commit 897fa5b
Show file tree
Hide file tree
Showing 20 changed files with 116 additions and 35 deletions.
16 changes: 15 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ ifeq ($(DYNLIBSUPPORT),true)
BASISDYNLIB=intinf msocket munix
endif


# Build the entire system for the first time

world:
Expand Down Expand Up @@ -112,11 +111,26 @@ install:
cd doc; $(MAKE) install
$(MAKE) basisdynlib_install

uninstall:
cd runtime; $(MAKE) uninstall
cd launch; $(MAKE) uninstall
cd mosmlyac; $(MAKE) uninstall
cd mosmllib; $(MAKE) uninstall
cd compiler; $(MAKE) uninstall
cd toolssrc; $(MAKE) uninstall
cd lex; $(MAKE) uninstall
cd doc; $(MAKE) uninstall
$(MAKE) basisdynlib_uninstall

basisdynlib_install:
for i in $(BASISDYNLIB); do \
(cd dynlibs/$$i; $(MAKE) install) || exit $$?; \
done

basisdynlib_uninstall:
for i in $(BASISDYNLIB); do \
(cd dynlibs/$$i; $(MAKE) uninstall) || exit $$?; \
done

# Remove all generated files
clean:
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ VERSION=2.10
INSTALL_PROGRAM=cp
INSTALL_SCRIPT=cp
INSTALL_DATA=cp
UNINSTALL_PROGRAM=rm -f
UNINSTALL_SCRIPT=rm -f
UNINSTALL_DATA=rm -f
PERL=perl

BASELIBS=-lm
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ install:
${INSTALL_DATA} mosmllnk $(DESTDIR)$(LIBDIR)
${INSTALL_DATA} mosmltop $(DESTDIR)$(LIBDIR)

uninstall:
cd $(DESTDIR)$(LIBDIR) && ${UNINSTALL_DATA} mosmlcmp mosmllnk mosmltop

install_w32:
${INSTALL_DATA} mosmlcmp.w32 $(DESTDIR)$(LIBDIR)/mosmlcmp
Expand Down
4 changes: 4 additions & 0 deletions src/doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ install:
# cp mosmllib2up.pdf $(DOCDIR)
cd helpsigs; $(MAKE) install

uninstall:
cd $(DESTDIR)$(DOCDIR) && ${UNINSTALL_DATA} mosmlref.pdf manual.pdf mosmllib.pdf
cd helpsigs; $(MAKE) uninstall

clean:
rm -f *.aux *.dvi *.blg *.bbl *.blg *.log *.ps
rm -f *.ind *.idx *.ilg *.toc
Expand Down
4 changes: 4 additions & 0 deletions src/doc/helpsigs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ install:
$(INSTALL_DATA) htmlsigs/*.html $(DESTDIR)$(DOCDIR)/mosmllib
$(INSTALL_DATA) index.html $(DESTDIR)$(DOCDIR)/mosmllib

uninstall:
${UNINSTALL_DATA} $(DESTDIR)$(LIBDIR)/helpsigs.val
${UNINSTALL_DATA} $(DESTDIR)$(DOCDIR)/mosmllib/*.html

depend: Lexer.sml Parser.sml
rm -f Makefile.bak
mv Makefile Makefile.bak
Expand Down
60 changes: 35 additions & 25 deletions src/dynlibs/Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@

all:
cd interface; make
cd intinf; make
cd mgd; make
cd mgdbm; make
cd mmysql; make
cd mpq; make
cd mregex; make
cd msocket; make
cd munix; make
cd interface; make
cd intinf; make
cd mgd; make
cd mgdbm; make
cd mmysql; make
cd mpq; make
cd mregex; make
cd msocket; make
cd munix; make

install:
cd intinf; make install
cd mgd; make install
cd mgdbm; make install
cd mmysql; make install
cd mpq; make install
cd mregex; make install
cd msocket; make install
cd munix; make install
cd intinf; make install
cd mgd; make install
cd mgdbm; make install
cd mmysql; make install
cd mpq; make install
cd mregex; make install
cd msocket; make install
cd munix; make install

uninstall:
cd intinf; make uninstall
cd mgd; make uninstall
cd mgdbm; make uninstall
cd mmysql; make uninstall
cd mpq; make uninstall
cd mregex; make uninstall
cd msocket; make uninstall
cd munix; make uninstall

test:
cd interface; make test
cd intinf; make test
cd mgd; make test
cd mgdbm; make test
cd mmysql; make test
cd mpq; make test
cd mregex; make test
cd munix; make test
cd interface; make test
cd intinf; make test
cd mgd; make test
cd mgdbm; make test
cd mmysql; make test
cd mpq; make test
cd mregex; make test
cd munix; make test

clean:
cd crypt; make clean
Expand Down
4 changes: 3 additions & 1 deletion src/dynlibs/intinf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ MOSMLTOOLS=camlrunm $(TOOLDIR)

all: libmgmp.so IntInf.uo


install:
$(INSTALL_DATA) libmgmp.so $(DESTDIR)$(LIBDIR)
$(INSTALL_DATA) IntInf.sig $(DESTDIR)$(LIBDIR)
$(INSTALL_DATA) IntInf.ui $(DESTDIR)$(LIBDIR)
$(INSTALL_DATA) IntInf.uo $(DESTDIR)$(LIBDIR)

uninstall:
cd $(DESTDIR)$(LIBDIR) && ${UNINSTALL_DATA} libmgmp.so IntInf.sig IntInf.ui IntInf.uo

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

Expand Down
5 changes: 4 additions & 1 deletion src/dynlibs/mgd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ test: Graphs.uo
mosml testgdimage.sml

install:
cp libmgd.so $(LIBDIR)
${INSTALL_DATA} libmgd.so $(LIBDIR)

uninstall:
${UNINSTALL_DATA} $(LIBDIR)/libmgd.so

clean:
rm -f *.o
Expand Down
5 changes: 4 additions & 1 deletion src/dynlibs/mgdbm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ BASELIBS=-lm -ldl
all: libmgdbm.so

install:
cp libmgdbm.so $(LIBDIR)
${INSTALL_DATA} libmgdbm.so $(LIBDIR)

uninstall:
${UNINSTALL_DATA} $(LIBDIR)/libmgdbm.so

mgdbm.o: mgdbm.c
$(CC) $(CFLAGS) -c -o mgdbm.o mgdbm.c
Expand Down
5 changes: 4 additions & 1 deletion src/dynlibs/mmysql/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ libmmysql.so: mmysql.o
# $(DYNLD) -o libmmysql.so mmysql.o -L${MYSQLLIBDIR} -lmysqlclient

install:
cp libmmysql.so $(LIBDIR)
${INSTALL_DATA} libmmysql.so $(LIBDIR)

uninstall:
${UNINSTALL_DATA} $(LIBDIR)/libmmysql.so

test:
mosml testmysql.sml
Expand Down
5 changes: 4 additions & 1 deletion src/dynlibs/mpq/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ libmpq.so: mpq.o
# $(DYNLD) -o libmpq.so mpq.o ${PGSQLLIBDIR}/libpq.a

install:
cp libmpq.so $(LIBDIR)
${INSTALL_DATA} libmpq.so $(LIBDIR)

uninstall:
${UNINSTALL_DATA} $(LIBDIR)/libmpq.so

test:
mosml testpsql.sml
Expand Down
5 changes: 4 additions & 1 deletion src/dynlibs/mregex/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ libmregex.so: mregex.o
$(DYNLD) -o libmregex.so regex-0.12/regex.o mregex.o

install:
cp libmregex.so $(LIBDIR)
${INSTALL_DATA} libmregex.so $(LIBDIR)

uninstall:
${UNINSTALL_DATA} $(LIBDIR)/libmregex.so

test:
mosml testregex.sml
Expand Down
3 changes: 3 additions & 0 deletions src/dynlibs/msocket/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ libmsocket.so: msocket.o
install:
$(INSTALL_DATA) libmsocket.so $(DESTDIR)$(LIBDIR)

uninstall:
${UNINSTALL_DATA} $(DESTDIR)$(LIBDIR)/libmsocket.so

test:
mosml testsocket.sml

Expand Down
3 changes: 3 additions & 0 deletions src/dynlibs/munix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ libmunix.so: munix.o
install:
$(INSTALL_DATA) libmunix.so $(DESTDIR)$(LIBDIR)

uninstall:
${UNINSTALL_DATA} $(DESTDIR)$(LIBDIR)/libmunix.so

test:
gcc -O2 -o sieve sieve.c
mosml testunix.sml
Expand Down
3 changes: 3 additions & 0 deletions src/launch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ old_install:
chmod a+x $(BINDIR)/$$script; \
done

uninstall:
${UNINSTALL_PROGRAM} $(DESTDIR)$(LIBDIR)/header
cd $(DESTDIR)$(BINDIR) && ${UNINSTALL_SCRIPT} mosml mosmlc mosmllex

mosml: mosml.tpl
sed -e "s|LIBDIR|$(LIBDIR)|" -e "s|BINDIR|$(BINDIR)|" mosml.tpl > mosml
Expand Down
3 changes: 3 additions & 0 deletions src/lex/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ clean:
install:
${INSTALL_DATA} mosmllex $(DESTDIR)$(LIBDIR)

uninstall:
${UNINSTALL_DATA} $(DESTDIR)$(LIBDIR)/mosmllex

Grammar.sml Grammar.sig: Grammar.grm
$(MOSMLYACC) Grammar.grm

Expand Down
3 changes: 3 additions & 0 deletions src/mosmllib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ install:
# rm -f $(DESTDIR)$(LIBDIR)/camlrunm
# ln -s $(BINDIR)/camlrunm $(LIBDIR)/camlrunm

uninstall:
cd $(DESTDIR)$(LIBDIR) && ${UNINSTALL_DATA} README *.ui *.uo *.sig General.sig Meta.sig

depend: Array.sml FileSys.sml Help.sml Int.sml Mosml.sml Path.sml \
Process.sml Strbase.sml Vector.sml Word.sml Word8Array.sml \
Word8Vector.sml Weak.sml
Expand Down
6 changes: 3 additions & 3 deletions src/mosmlyac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ mosmlyac.exe: $(OBJS)
$(CC) $(CFLAGS) -o mosmlyac.exe $(OBJS) -mconsole
$(STRIP) mosmlyac.exe


clean_obj:
rm -f *.o

clean: clean_obj
rm -f mosmlyac mosmlyac.exe



install:
${INSTALL_PROGRAM} mosmlyac$(EXE) $(DESTDIR)$(BINDIR)/mosmlyac$(EXE)

uninstall:
${UNINSTALL_PROGRAM} $(DESTDIR)$(BINDIR)/mosmlyac$(EXE)

depend:

closure.o: defs.h
Expand Down
9 changes: 9 additions & 0 deletions src/runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,20 @@ install:
${INSTALL_PROGRAM} camlrunm$(EXE) $(DESTDIR)$(LIBDIR)
${INSTALL_DATA} *.h $(DESTDIR)$(INCDIR)

uninstall:
${UNINSTALL_PROGRAM} $(DESTDIR)$(BINDIR)/camlrunm$(EXE)
${UNINSTALL_PROGRAM} $(DESTDIR)$(LIBDIR)/camlrunm$(EXE)
cd $(DESTDIR)$(INCDIR) && ${UNINSTALL_DATA} *.h

install_w32: camlrt.dll
${INSTALL_PROGRAM} camlrt.dll $(DESTDIR)$(BINDIR)
${INSTALL_PROGRAM} camlrt.dll $(DESTDIR)$(LIBDIR)
${INSTALL_DATA} *.h $(DESTDIR)$(INCDIR)

uninstall_w32:
${UNINSTALL_PROGRAM} $(DESTDIR)$(BINDIR)/camlrt.dll
${UNINSTALL_PROGRAM} $(DESTDIR)$(LIBDIR)/camlrt.dll
cd $(DESTDIR}$(INCDIR) && ${UNINSTALL_DATA} *.h

primitives : $(PRIMS)
sed -n -e '/\/\* ML \*\//s/.* \([a-zA-Z0-9_][a-zA-Z0-9_]*\) *(.*/\1/p' \
Expand Down
3 changes: 3 additions & 0 deletions src/toolssrc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ clean:
install:
${INSTALL_DATA} cutdeps mosmldep $(DESTDIR)$(TOOLDIR)

uninstall:
cd $(DESTDIR)$(TOOLDIR) && ${UNINSTALL_DATA} cutdeps mosmldep

depend: Deplex.sml Deppars.sml Mosmldep.sml
rm -f Makefile.bak
mv Makefile Makefile.bak
Expand Down

0 comments on commit 897fa5b

Please sign in to comment.