diff options
author | EuAndreh <eu@euandre.org> | 2024-05-23 17:37:33 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-05-23 17:37:33 -0300 |
commit | 666cb974379ebf84706bb3373ce5eda1eb96c11d (patch) | |
tree | 0f893784adee5b567d00e7772092686c7a56700a | |
parent | Normalize all "color" to "colour" (diff) | |
download | pindaiba-666cb974379ebf84706bb3373ce5eda1eb96c11d.tar.gz pindaiba-666cb974379ebf84706bb3373ce5eda1eb96c11d.tar.xz |
Makefile: Normalize alongsside parallel projects
-rw-r--r-- | Makefile | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -3,7 +3,6 @@ DATE = 1970-01-01 VERSION = 0.1.0 NAME = pindaiba NAME_UC = PindaĆba -MAILING_LIST = public-inbox LANGUAGES = en ## Installation prefix. Defaults to "/usr". PREFIX = /usr @@ -43,13 +42,14 @@ LDLIBS = -lsiphash all: include deps.mk + catalogs.cat = $(catalogs.msg:.msg=.cat) -sources.h = $(sources.c:.c=.h) -sources.o = $(sources.c:.c=.o) -tests.o = $(tests.c:.c=.o) -tests.a = $(tests.c:.c=.a) -tests.bin = $(tests.c:.c=.bin) +sources.h = $(sources.c:.c=.h) +sources.o = $(sources.c:.c=.o) +tests.o = $(tests.c:.c=.o) +tests.a = $(tests.c:.c=.a) +tests.bin = $(tests.c:.c=.bin) archives = \ lib$(NAME).a \ @@ -67,16 +67,14 @@ sources = \ derived-assets = \ - lib$(NAME).a \ + $(archives) \ src/config.h \ $(catalogs.cat) \ $(sources.o) \ $(tests.o) \ - $(tests.a) \ $(tests.bin) \ tests/slurp.o \ src/main.o \ - $(NAME).a \ $(NAME).bin \ side-assets = \ @@ -92,9 +90,10 @@ all: $(derived-assets) lib$(NAME).a: $(sources.o) $(NAME).a: $(sources.o) src/main.o -$(derived-assets): Makefile deps.mk -$(sources.o) $(tests.o) src/main.o tests/slurp.o: src/config.h +src/config.h: Makefile deps.mk +$(sources.o) $(tests.o) src/main.o: Makefile deps.mk src/config.h src/main.o: src/$(NAME).h +tests/slurp.o: src/config.h $(archives): @@ -116,7 +115,7 @@ check-unit: $(tests.bin-check) integration-tests = \ - tests/cli-opts.sh \ + tests/cli-opts.sh \ $(integration-tests): $(NAME).bin ALWAYS sh $@ $(EXEC)$(NAME).bin @@ -146,15 +145,17 @@ install: all '$(DESTDIR)$(SRCDIR)' \ '$(DESTDIR)$(INCLUDEDIR)' \ '$(DESTDIR)$(INCLUDEDIR)'/$(NAME)/ + cp $(NAME).bin '$(DESTDIR)$(BINDIR)'/$(NAME) cp lib$(NAME).a '$(DESTDIR)$(LIBDIR)' cp src/$(NAME).h '$(DESTDIR)$(INCLUDEDIR)' cp $(sources.h) '$(DESTDIR)$(INCLUDEDIR)'/$(NAME)/ cp $(sources) '$(DESTDIR)$(SRCDIR)' - for l in $(LANGUAGES); do \ + for c in $(catalogs.cat); do \ + l="`echo "$$c" | cut -d. -f2`"; \ dir='$(DESTDIR)$(LOCALEDIR)'/"$$l"/LC_MESSAGES; \ mkdir -p "$$dir"; \ - cp src/$(NAME)."$$l".cat "$$dir"/$(NAME).cat; \ + cp "$$c" "$$dir"/$(NAME).cat; \ done ## Uninstalls from $(DESTDIR)$(PREFIX). This is a perfect mirror @@ -166,8 +167,10 @@ uninstall: '$(DESTDIR)$(LIBDIR)'/lib$(NAME).a \ '$(DESTDIR)$(INCLUDEDIR)'/$(NAME).h \ '$(DESTDIR)$(INCLUDEDIR)'/$(NAME)/ \ - '$(DESTDIR)$(SRCDIR)' - for l in $(LANGUAGES); do \ + '$(DESTDIR)$(SRCDIR)' \ + + for c in $(catalogs.cat); do \ + l="`echo "$$c" | cut -d. -f2`"; \ rm -f '$(DESTDIR)$(LOCALEDIR)'/"$$l"/LC_MESSAGES/$(NAME).cat; \ done |