mirror of
https://github.com/javalsai/lidm.git
synced 2026-02-27 12:00:44 +01:00
clean: makefile clutter
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,5 +8,3 @@ valgrind-out.txt
|
|||||||
|
|
||||||
# nix build result
|
# nix build result
|
||||||
result
|
result
|
||||||
|
|
||||||
include/version.h
|
|
||||||
|
|||||||
33
Makefile
33
Makefile
@@ -8,34 +8,25 @@ ODIR=dist
|
|||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
|
|
||||||
CC?=gcc
|
INFO_GIT_REV ?= $(shell git describe --long --tags --always || echo '?')
|
||||||
|
INFO_BUILD_TS ?= $(shell date +%s)
|
||||||
|
|
||||||
CFLAGS ?= -O3 -Wall -Wextra -fdata-sections -ffunction-sections
|
CFLAGS ?= -O3 -Wall -Wextra -fdata-sections -ffunction-sections
|
||||||
# C PreProcessor flags, not C Plus Plus
|
# C PreProcessor flags, not C Plus Plus
|
||||||
CPPFLAGS ?=
|
CPPFLAGS ?=
|
||||||
ALLFLAGS=$(CFLAGS) $(CPPFLAGS) -I$(IDIR)
|
_DFLAGS?= \
|
||||||
|
-DLIDM_VERSION=\"$(VERSION)\" \
|
||||||
|
-DLIDM_GIT_REV=\"$(INFO_GIT_REV)\" \
|
||||||
|
-DLIDM_BUILD_TS=$(INFO_BUILD_TS)
|
||||||
|
ALLFLAGS = $(_DFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(IDIR)
|
||||||
LDFLAGS ?= -Wl,--gc-sections
|
LDFLAGS ?= -Wl,--gc-sections
|
||||||
|
|
||||||
LIBS = -lpam
|
LIBS = -lpam
|
||||||
|
|
||||||
_DEPS = version.h log.h util.h ui.h ui_state.h config.h pam.h desktop.h desktop_exec.h auth.h ofield.h efield.h keys.h users.h sessions.h chvt.h macros.h launch_state.h signal_handler.h
|
# includes all headers in `$(IDIR)` and compiles everything in `$(CDIR)`
|
||||||
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
|
DEPS = $(wildcard $(IDIR)/*.h)
|
||||||
|
_SOURCES = $(notdir $(wildcard $(CDIR)/*.c))
|
||||||
_OBJ = main.o log.o util.o ui.o ui_state.o config.o pam.o desktop.o desktop_exec.o auth.o ofield.o efield.o users.o sessions.o chvt.o launch_state.o signal_handler.o
|
OBJ = $(patsubst %.c,$(ODIR)/%.o,$(_SOURCES))
|
||||||
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
|
|
||||||
|
|
||||||
INFO_GIT_REV?=$$(git describe --long --tags --always || echo '?')
|
|
||||||
INFO_BUILD_TS?=$$(date +%s)
|
|
||||||
|
|
||||||
$(IDIR)/version.h: Makefile
|
|
||||||
@tmp=$$(mktemp); \
|
|
||||||
printf '' > $$tmp; \
|
|
||||||
echo '#define LIDM_VERSION "'$(VERSION)'"' >> $$tmp; \
|
|
||||||
echo '#define LIDM_GIT_REV "'$(INFO_GIT_REV)'"' >> $$tmp; \
|
|
||||||
echo '#define LIDM_BUILD_TS '$(INFO_BUILD_TS) >> $$tmp; \
|
|
||||||
if ! cmp -s $$tmp $@; then \
|
|
||||||
mv $$tmp $@; \
|
|
||||||
fi; \
|
|
||||||
rm -f $$tmp;
|
|
||||||
|
|
||||||
$(ODIR)/%.o: $(CDIR)/%.c $(DEPS)
|
$(ODIR)/%.o: $(CDIR)/%.c $(DEPS)
|
||||||
@mkdir -p $(ODIR)
|
@mkdir -p $(ODIR)
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "users.h"
|
#include "users.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
#define DATESTR_MAXBUFSIZE 0x20
|
#define DATESTR_MAXBUFSIZE 0x20
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user