makefiles uninstall

This commit is contained in:
p.kosyh 2009-09-23 04:21:24 +00:00
parent 5bd4dcbd1e
commit 2a3632b69b
12 changed files with 115 additions and 30 deletions

View file

@ -1,4 +1,6 @@
SUBDIRS = src/sdl-instead stead games themes icon desktop doc languages
include Rules.make
SUBDIRS = src/sdl-instead stead games themes icon desktop doc languages
all:
@for dir in $(SUBDIRS); do \
@ -11,8 +13,20 @@ clean:
done;
install: all
ifeq ($(SYSTEMSETUP), yes)
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir install || exit 1; \
done;
else
echo No install needed
endif
uninstall:
ifeq ($(SYSTEMSETUP), yes)
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir uninstall || exit 1; \
done;
$(RM) -rf $(STEADPATH)
else
echo No uninstall needed
endif

View file

@ -9,14 +9,15 @@ ICONPATH=./icon
LANGPATH=./languages
DOCPATH=
MANPATH=
SYSTEMSETUP=no
LUA_CFLAGS=$(shell pkg-config --cflags lua5.1)
LUA_LFLAGS=$(shell pkg-config --libs lua5.1)
# for arch linux, fedora (may be others) use this
#
# LUA_CFLAGS=$(shell pkg-config --cflags lua)
# LUA_LFLAGS=$(shell pkg-config --libs lua)
LUA_CFLAGS=$(shell pkg-config --cflags lua)
LUA_LFLAGS=$(shell pkg-config --libs lua)
#
SDL_CFLAGS=$(shell sdl-config --cflags)
@ -24,9 +25,11 @@ SDL_LFLAGS=$(shell sdl-config --libs) -lSDL_ttf -lSDL_mixer -lSDL_image
CFLAGS += -g -Wall -D_HAVE_ICONV
INSTALLD=echo
INSTALL=echo
EXE=
INSTALLD=echo "Do not install standalone version!"
INSTALLB=echo "Do not install standalone version!"
INSTALL=echo "Do not install standalone version!"
EXE=
PLATFORM=unix.c
RESOURCES=
RM=rm

View file

@ -10,6 +10,7 @@ ICONPATH=$(DESTDIR)$(PREFIX)/share/pixmaps
DOCPATH=$(DESTDIR)$(PREFIX)/share/doc/instead
LANGPATH=$(STEADPATH)/languages
MANPATH=$(DESTDIR)$(PREFIX)/share/man/man6
SYSTEMSETUP=yes
LUA_CFLAGS=$(shell pkg-config --cflags lua5.1)
LUA_LFLAGS=$(shell pkg-config --libs lua5.1)
@ -26,8 +27,10 @@ SDL_LFLAGS=$(shell sdl-config --libs) -lSDL_ttf -lSDL_mixer -lSDL_image
CFLAGS += -Wall -D_HAVE_ICONV
INSTALLD=install -d -m 0755
INSTALL=install -m 0755
INSTALLB=install -m 0755
INSTALL=install -m 0644
EXE=
PLATFORM=unix.c
RESOURCES=
RM=rm

View file

@ -8,6 +8,12 @@ instead.desktop: instead.desktop.in
cat instead.desktop.in | sed -e "s|@BIN|$(BIN)|g" > instead.desktop
install:
install -d -m 0755 $(DESTDIR)$(PREFIX)/share/applications
install -m 0644 instead.desktop $(DESTDIR)$(PREFIX)/share/applications/instead.desktop
$(INSTALLD) $(DESTDIR)$(PREFIX)/share/applications
$(INSTALL) instead.desktop $(DESTDIR)$(PREFIX)/share/applications/instead.desktop
ifeq ($(SYSTEMSETUP), yes)
uninstall:
$(RM) $(DESTDIR)$(PREFIX)/share/applications/instead.desktop
else
uninstall:
endif

View file

@ -2,7 +2,15 @@ include ../Rules.make
clean:
all:
install:
install -d -m0755 $(DOCPATH)
install -m0644 *.jpg *.html *.txt $(DOCPATH)
install -d -m0755 $(MANPATH)
install -m0644 *.6 $(MANPATH)
$(INSTALLD) $(DOCPATH)
$(INSTALL) *.jpg *.html *.txt $(DOCPATH)
$(INSTALLD) $(MANPATH)
$(INSTALL) *.6 $(MANPATH)
ifeq ($(SYSTEMSETUP), yes)
uninstall:
$(RM) -rf $(DOCPATH)
$(RM) $(MANPATH)/instead.*
else
uninstall:
endif

View file

@ -1,10 +1,20 @@
include ../Rules.make
all:
install:
install -d -m0755 $(GAMESPATH)
ifeq ($(SYSTEMSETUP), yes)
$(INSTALLD) $(GAMESPATH)
for f in *; do \
if [ ! -d $$f ]; then continue; fi;\
install -d -m0755 $(GAMESPATH)/$$f;\
$(INSTALLD) $(GAMESPATH)/$$f; \
tar --exclude=".svn" -c -C $$f . | tar -x -C $(GAMESPATH)/$$f;\
done
endif
ifeq ($(SYSTEMSETUP), yes)
uninstall:
$(RM) -rf $(GAMESPATH)
else
uninstall:
endif
clean:

View file

@ -2,6 +2,12 @@ include ../Rules.make
clean:
all:
install:
install -d -m0755 $(ICONPATH)
install -m0644 sdl_instead.png $(ICONPATH)
$(INSTALLD) $(ICONPATH)
$(INSTALL) sdl_instead.png $(ICONPATH)
ifeq ($(SYSTEMSETUP), yes)
uninstall:
$(RM) $(ICONPATH)/sdl_instead.png
else
uninstall:
endif

View file

@ -2,7 +2,14 @@ include ../Rules.make
clean:
all:
install:
install -d -m0755 $(LANGPATH)
$(INSTALLD) $(LANGPATH)
for f in *.ini; do \
install -m0644 $$f $(LANGPATH)/$$f;\
$(INSTALL) $$f $(LANGPATH)/$$f;\
done
ifeq ($(SYSTEMSETUP), yes)
uninstall:
$(RM) -rf $(LANGPATH)
else
uninstall:
endif

View file

@ -4,8 +4,14 @@ all: instead
instead: instead.c rline.c
$(CC) $(CFLAGS) -DSTEAD_PATH=\"${STEADPATH}/\" instead.c $(LUA_CFLAGS) rline.c $(LUA_LFLAGS) -lncurses -lreadline -o instead
clean:
rm -rf *.o instead
$(RM) -rf *.o instead
install:
install -d -m 0755 $(BIN)
install -m 0755 instead $(BIN)/instead
$(INSTALLD) $(BIN)
$(INSTALLB) instead $(BIN)/instead
ifeq ($(SYSTEMSETUP), yes)
uninstall:
$(RM) $(BIN)/instead
else
uninstall:
endif

View file

@ -18,7 +18,14 @@ sdl-instead$(EXE): $(OBJ) $(RESOURCES)
install:
$(INSTALLD) $(BIN)
$(INSTALL) sdl-instead$(EXE) $(BIN)/sdl-instead$(EXE)
$(INSTALLB) sdl-instead$(EXE) $(BIN)/sdl-instead$(EXE)
ifeq ($(SYSTEMSETUP), yes)
uninstall:
$(RM) $(BIN)/sdl-instead$(EXE)
else
uninstall:
endif
clean:
$(RM) -f *.o sdl-instead$(EXE)

View file

@ -3,7 +3,14 @@ clean:
all: stead.lua
install:
install -m 0755 -d $(STEADPATH)
install -m 0644 stead.lua $(STEADPATH)/stead.lua
install -m 0644 gui.lua $(STEADPATH)/gui.lua
$(INSTALLD) $(STEADPATH)
$(INSTALL) stead.lua $(STEADPATH)/stead.lua
$(INSTALL) gui.lua $(STEADPATH)/gui.lua
ifeq ($(SYSTEMSETUP), yes)
uninstall:
$(RM) $(STEADPATH)/stead.lua
$(RM) $(STEADPATH)/gui.lua
else
uninstall:
endif

View file

@ -2,10 +2,18 @@ include ../Rules.make
clean:
all:
install:
install -d -m0755 $(THEMESPATH)
ifeq ($(SYSTEMSETUP), yes)
$(INSTALLD) $(THEMESPATH)
for f in *; do \
if [ ! -d $$f ]; then continue; fi;\
install -d -m0755 $(THEMESPATH)/$$f;\
$(INSTALLD) $(THEMESPATH)/$$f;\
tar --exclude=".svn" -c -C $$f . | tar -x -C $(THEMESPATH)/$$f;\
done
endif
ifeq ($(SYSTEMSETUP), yes)
uninstall:
$(RM) -rf $(THEMESPATH)
else
uninstall:
endif