Makefile 1.2 KB
Newer Older
akiraohgaki's avatar
akiraohgaki committed
1 2
SHELL = /bin/sh

akiraohgaki's avatar
akiraohgaki committed
3
TARGET = ocs-store
akiraohgaki's avatar
akiraohgaki committed
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
srcdir = .

DESTDIR =
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
datadir = $(prefix)/share

INSTALL = install
INSTALL_PROGRAM = $(INSTALL) -D -m 755
INSTALL_DATA = $(INSTALL) -D -m 644
MKDIR = mkdir -p
CP = cp -Rpf
RM = rm -rf

.PHONY: all rebuild build clean install uninstall

all: rebuild ;

rebuild: clean build ;

build: $(TARGET) ;

clean:
	$(RM) $(srcdir)/node_modules
akiraohgaki's avatar
akiraohgaki committed
30
	$(RM) $(srcdir)/dist
akiraohgaki's avatar
akiraohgaki committed
31 32

install:
akiraohgaki's avatar
akiraohgaki committed
33
	$(INSTALL_PROGRAM) $(srcdir)/launcher/$(TARGET) $(DESTDIR)$(bindir)/$(TARGET)
akiraohgaki's avatar
akiraohgaki committed
34
	$(MKDIR) $(DESTDIR)$(libdir)
akiraohgaki's avatar
akiraohgaki committed
35
	$(CP) $(srcdir)/dist/$(TARGET)-linux-x64 $(DESTDIR)$(libdir)
akiraohgaki's avatar
akiraohgaki committed
36 37 38 39 40 41 42 43 44
	$(INSTALL_DATA) $(srcdir)/desktop/$(TARGET).desktop $(DESTDIR)$(datadir)/applications/$(TARGET).desktop
	$(INSTALL_DATA) $(srcdir)/desktop/$(TARGET).svg $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/$(TARGET).svg

uninstall:
	$(RM) $(DESTDIR)$(bindir)/$(TARGET)
	$(RM) $(DESTDIR)$(libdir)/$(TARGET)-linux-x64
	$(RM) $(DESTDIR)$(datadir)/applications/$(TARGET).desktop
	$(RM) $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/$(TARGET).svg

akiraohgaki's avatar
akiraohgaki committed
45
$(TARGET): $(TARGET)-linux-x64 ;
akiraohgaki's avatar
akiraohgaki committed
46

47
$(TARGET)-linux-x64:
akiraohgaki's avatar
akiraohgaki committed
48 49
	cd $(srcdir) ; \
		npm install ; \
akiraohgaki's avatar
akiraohgaki committed
50
		npm run package