Reverted broken makefile (creates broken icon directories and fails).

This commit is contained in:
Steve 2016-04-25 07:44:09 +01:00
parent b732d6c08b
commit 304995f88b
1 changed files with 29 additions and 40 deletions

View File

@ -1,18 +1,10 @@
PROG = tbftss PROG = tbftss
CC = gcc CC = gcc
PREFIX ?= /usr/local BIN_DIR = /usr/bin
BIN_DIR ?= $(PREFIX)/bin DATA_DIR = /opt/tbftss
DATA_DIR ?= $(PREFIX)/share/$(PROG) LOCALE_DIR = /usr/share/locale
LOCALE_DIR = $(PREFIX)/share/locale ICON_DIR = /usr/share/icons/hicolor
ICON_DIR = $(PREFIX)/share/icons/hicolor DESKTOP_DIR = /usr/share/applications
DESKTOP_DIR = $(PREFIX)/share/applications
DESTDIR ?=
INST_BIN_DIR = $(DESTDIR)$(BIN_DIR)
INST_DATA_DIR = $(DESTDIR)$(DATA_DIR)
INST_LOCALE_DIR = $(DESTDIR)$(LOCALE_DIR)
INST_ICON_DIR = $(DESTDIR)$(ICON_DIR)
INST_DESKTOP_DIR = $(DESTDIR)$(DESKTOP_DIR)
SEARCHPATH += src/plat/unix SEARCHPATH += src/plat/unix
OBJS += unixInit.o OBJS += unixInit.o
@ -22,9 +14,9 @@ include common.mk
CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -DDATA_DIR=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\" CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -DDATA_DIR=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\"
CXXFLAGS += -Wall -Wempty-body -ansi -pedantic -Werror -Wstrict-prototypes CXXFLAGS += -Wall -Wempty-body -ansi -pedantic -Werror -Wstrict-prototypes
CXXFLAGS += -g -lefence CXXFLAGS += -g -lefence
#CXXFLAGS += -O2 -Wno-unused-result CXXFLAGS += -O2 -Wno-unused-result
LFLAGS := `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm $(LDFLAGS) LFLAGS := `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm
DIST_FILES = data gfx manual music sound src LICENSE makefile* common.mk README.md CHANGELOG DIST_FILES = data gfx manual music sound src LICENSE makefile* common.mk README.md CHANGELOG
@ -33,40 +25,37 @@ $(PROG): $(OBJS)
$(CC) -o $@ $(OBJS) $(LFLAGS) $(CC) -o $@ $(OBJS) $(LFLAGS)
install: install:
install -d $(INST_BIN_DIR) cp $(PROG) $(BIN_DIR)
install -m 0755 $(PROG) $(INST_BIN_DIR) mkdir -p $(DATA_DIR)
install -d $(INST_DATA_DIR) cp -r data $(DATA_DIR)
cp -r data $(INST_DATA_DIR) cp -r gfx $(DATA_DIR)
cp -r gfx $(INST_DATA_DIR) cp -r manual $(DATA_DIR)
cp -r manual $(INST_DATA_DIR) cp -r music $(DATA_DIR)
cp -r music $(INST_DATA_DIR) cp -r sound $(DATA_DIR)
cp -r sound $(INST_DATA_DIR) cp -p icons/$(PROG)-16x16.png $(ICON_DIR)/16x16/apps/$(PROG).png
install -d $(INST_ICON_DIR)/{16x16,32x32,64x64,128x128}/apps cp -p icons/$(PROG)-32x32.png $(ICON_DIR)/32x32/apps/$(PROG).png
cp -p icons/$(PROG)-16x16.png $(INST_ICON_DIR)/16x16/apps/$(PROG).png cp -p icons/$(PROG)-64x64.png $(ICON_DIR)/64x64/apps/$(PROG).png
cp -p icons/$(PROG)-32x32.png $(INST_ICON_DIR)/32x32/apps/$(PROG).png cp -p icons/$(PROG)-128x128.png $(ICON_DIR)/128x128/apps/$(PROG).png
cp -p icons/$(PROG)-64x64.png $(INST_ICON_DIR)/64x64/apps/$(PROG).png cp -p icons/$(PROG).desktop $(DESKTOP_DIR)
cp -p icons/$(PROG)-128x128.png $(INST_ICON_DIR)/128x128/apps/$(PROG).png
install -d $(INST_DESKTOP_DIR)
cp -p icons/$(PROG).desktop $(INST_DESKTOP_DIR)
@for f in $(LOCALE_MO); do \ @for f in $(LOCALE_MO); do \
lang=`echo $$f | sed -e 's/^locale\///;s/\.mo$$//'`; \ lang=`echo $$f | sed -e 's/^locale\///;s/\.mo$$//'`; \
install -d $(INST_LOCALE_DIR)/$$lang/LC_MESSAGES; \ mkdir -p $(LOCALE_DIR)/$$lang/LC_MESSAGES; \
cp -v $$f $(INST_LOCALE_DIR)/$$lang/LC_MESSAGES/$(PROG).mo; \ cp -v $$f $(LOCALE_DIR)/$$lang/LC_MESSAGES/$(PROG).mo; \
done done
uninstall: uninstall:
$(RM) $(INST_BIN_DIR)/$(PROG) $(RM) $(BIN_DIR)/$(PROG)
$(RM) -rf $(INST_DATA_DIR) $(RM) -rf $(DATA_DIR)
$(RM) $(INST_ICON_DIR)/16x16/apps/$(PROG).png $(RM) $(ICON_DIR)/16x16/apps/$(PROG).png
$(RM) $(INST_ICON_DIR)/32x32/apps/$(PROG).png $(RM) $(ICON_DIR)/32x32/apps/$(PROG).png
$(RM) $(INST_ICON_DIR)/64x64/apps/$(PROG).png $(RM) $(ICON_DIR)/64x64/apps/$(PROG).png
$(RM) $(INST_ICON_DIR)/128x128/apps/$(PROG).png $(RM) $(ICON_DIR)/128x128/apps/$(PROG).png
$(RM) $(INST_DESKTOP_DIR)/$(PROG).desktop $(RM) $(DESKTOP_DIR)/$(PROG).desktop
@for f in $(LOCALE_MO); do \ @for f in $(LOCALE_MO); do \
lang=`echo $$f | sed -e 's/^locale\///;s/\.mo$$//'`; \ lang=`echo $$f | sed -e 's/^locale\///;s/\.mo$$//'`; \
$(RM) -v $(INST_LOCALE_DIR)/$$lang/LC_MESSAGES/$(PROG).mo; \ $(RM) -v $(LOCALE_DIR)/$$lang/LC_MESSAGES/$(PROG).mo; \
done done
# prepare an archive for the program # prepare an archive for the program