mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
Makefile: more robust generated header tracking (#1439)
give each generated header it's own unique file so that it's not possible to try and build `O_EMOJI=1` with the generated header for `O_NERD=1`.
This commit is contained in:
parent
f2a38b0e22
commit
f618b78866
26
Makefile
26
Makefile
|
@ -95,15 +95,18 @@ ifeq ($(strip $(O_CTX8)),1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(O_ICONS)),1)
|
ifeq ($(strip $(O_ICONS)),1)
|
||||||
CPPFLAGS += -DICONS_IN_TERM
|
ICONS_INCLUDE = icons-generated-icons-in-term.h
|
||||||
|
CPPFLAGS += -DICONS_IN_TERM -DICONS_INCLUDE=\"$(ICONS_INCLUDE)\"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(O_NERD)),1)
|
ifeq ($(strip $(O_NERD)),1)
|
||||||
CPPFLAGS += -DNERD
|
ICONS_INCLUDE = icons-generated-nerd.h
|
||||||
|
CPPFLAGS += -DNERD -DICONS_INCLUDE=\"$(ICONS_INCLUDE)\"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(O_EMOJI)),1)
|
ifeq ($(strip $(O_EMOJI)),1)
|
||||||
CPPFLAGS += -DEMOJI
|
ICONS_INCLUDE = icons-generated-emoji.h
|
||||||
|
CPPFLAGS += -DEMOJI -DICONS_INCLUDE=\"$(ICONS_INCLUDE)\"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(O_QSORT)),1)
|
ifeq ($(strip $(O_QSORT)),1)
|
||||||
|
@ -191,13 +194,13 @@ ifeq ($(strip $(O_QSORT)),1)
|
||||||
HEADERS += src/qsort.h
|
HEADERS += src/qsort.h
|
||||||
endif
|
endif
|
||||||
ifeq ($(strip $(O_EMOJI)),1)
|
ifeq ($(strip $(O_EMOJI)),1)
|
||||||
HEADERS += src/icons.h src/icons-generated.h
|
HEADERS += src/icons.h src/$(ICONS_INCLUDE)
|
||||||
endif
|
endif
|
||||||
ifeq ($(strip $(O_NERD)),1)
|
ifeq ($(strip $(O_NERD)),1)
|
||||||
HEADERS += src/icons.h src/icons-generated.h
|
HEADERS += src/icons.h src/$(ICONS_INCLUDE)
|
||||||
endif
|
endif
|
||||||
ifeq ($(strip $(O_ICONS)),1)
|
ifeq ($(strip $(O_ICONS)),1)
|
||||||
HEADERS += src/icons.h src/icons-generated.h src/icons-in-terminal.h
|
HEADERS += src/icons.h src/$(ICONS_INCLUDE) src/icons-in-terminal.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
|
@ -207,16 +210,15 @@ $(BIN): $(SRC) $(HEADERS) Makefile
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(GETTIME_C) $< $(LDLIBS)
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(GETTIME_C) $< $(LDLIBS)
|
||||||
@$(MAKE) --silent postpatch
|
@$(MAKE) --silent postpatch
|
||||||
|
|
||||||
src/icons-generated.h: src/icons-hash-gen
|
|
||||||
@./$< > $@
|
|
||||||
src/icons-hash-gen: src/icons-hash.c src/nnn.c src/icons.h src/nnn.h
|
|
||||||
$(CC) $(CPPFLAGS) -DICONS_GENERATE -o $@ src/icons-hash.c
|
|
||||||
|
|
||||||
# targets for backwards compatibility
|
# targets for backwards compatibility
|
||||||
debug: $(BIN)
|
debug: $(BIN)
|
||||||
norl: $(BIN)
|
norl: $(BIN)
|
||||||
nolc: $(BIN)
|
nolc: $(BIN)
|
||||||
|
|
||||||
|
src/$(ICONS_INCLUDE): src/icons-hash.c src/icons.h src/icons-in-terminal.h
|
||||||
|
$(CC) $(CPPFLAGS) -DICONS_GENERATE -o src/icons-hash-gen src/icons-hash.c
|
||||||
|
./src/icons-hash-gen > $@
|
||||||
|
|
||||||
install-desktop: $(DESKTOPFILE)
|
install-desktop: $(DESKTOPFILE)
|
||||||
$(INSTALL) -m 0755 -d $(DESTDIR)$(DESKTOPPREFIX)
|
$(INSTALL) -m 0755 -d $(DESTDIR)$(DESKTOPPREFIX)
|
||||||
$(INSTALL) -m 0644 $(DESKTOPFILE) $(DESTDIR)$(DESKTOPPREFIX)
|
$(INSTALL) -m 0644 $(DESKTOPFILE) $(DESTDIR)$(DESKTOPPREFIX)
|
||||||
|
@ -318,7 +320,7 @@ upload-local: sign static musl
|
||||||
--upload-file $(BIN)-musl-static-$(VERSION).x86_64.tar.gz
|
--upload-file $(BIN)-musl-static-$(VERSION).x86_64.tar.gz
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -f $(BIN) nnn-$(VERSION).tar.gz *.sig $(BIN)-static $(BIN)-static-$(VERSION).x86_64.tar.gz $(BIN)-icons-static $(BIN)-icons-static-$(VERSION).x86_64.tar.gz $(BIN)-nerd-static $(BIN)-nerd-static-$(VERSION).x86_64.tar.gz $(BIN)-emoji-static $(BIN)-emoji-static-$(VERSION).x86_64.tar.gz $(BIN)-musl-static $(BIN)-musl-static-$(VERSION).x86_64.tar.gz src/icons-hash-gen src/icons-generated.h
|
$(RM) -f $(BIN) nnn-$(VERSION).tar.gz *.sig $(BIN)-static $(BIN)-static-$(VERSION).x86_64.tar.gz $(BIN)-icons-static $(BIN)-icons-static-$(VERSION).x86_64.tar.gz $(BIN)-nerd-static $(BIN)-nerd-static-$(VERSION).x86_64.tar.gz $(BIN)-emoji-static $(BIN)-emoji-static-$(VERSION).x86_64.tar.gz $(BIN)-musl-static $(BIN)-musl-static-$(VERSION).x86_64.tar.gz src/icons-hash-gen src/icons-generated-*.h
|
||||||
|
|
||||||
checkpatches:
|
checkpatches:
|
||||||
./patches/check-patches.sh
|
./patches/check-patches.sh
|
||||||
|
|
|
@ -125,7 +125,7 @@
|
||||||
|
|
||||||
#if defined(ICONS_IN_TERM) || defined(NERD) || defined(EMOJI)
|
#if defined(ICONS_IN_TERM) || defined(NERD) || defined(EMOJI)
|
||||||
#define ICONS_ENABLED
|
#define ICONS_ENABLED
|
||||||
#include "icons-generated.h"
|
#include ICONS_INCLUDE
|
||||||
#include "icons-hash.c"
|
#include "icons-hash.c"
|
||||||
#include "icons.h"
|
#include "icons.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue