From 82a7dfc5f059ea88ecaf8af30dc6545af27df844 Mon Sep 17 00:00:00 2001 From: DTB Date: Thu, 14 Sep 2023 10:06:25 -0400 Subject: [PATCH] trim down build --- dmenubar/LICENSE | 2 +- dmenubar/Makefile | 64 +++++++++++++++++++++------------------------- dmenubar/arg.h | 49 ----------------------------------- dmenubar/config.mk | 31 ---------------------- 4 files changed, 30 insertions(+), 116 deletions(-) delete mode 100644 dmenubar/arg.h delete mode 100644 dmenubar/config.mk diff --git a/dmenubar/LICENSE b/dmenubar/LICENSE index 8a92974..a72c631 100644 --- a/dmenubar/LICENSE +++ b/dmenubar/LICENSE @@ -10,7 +10,7 @@ MIT/X Consortium License © 2010-2012 Connor Lane Smith © 2014-2020 Hiltjo Posthuma © 2015-2019 Quentin Rameau -© 2021 Deven Blake +© 2021-2023 Deven Blake Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/dmenubar/Makefile b/dmenubar/Makefile index 989fbc9..c9462e3 100644 --- a/dmenubar/Makefile +++ b/dmenubar/Makefile @@ -1,18 +1,38 @@ -# dmenu - dynamic menu -# See LICENSE file for copyright and license details. +X11INC = /usr/X11R6/include +X11LIB = /usr/X11R6/lib -include config.mk +# Xinerama, comment if you don't want it +XINERAMALIBS = -lXinerama +XINERAMAFLAGS = -DXINERAMA -SRC = drw.c dmenubar.c util.c -OBJ = $(SRC:.c=.o) +# freetype +FREETYPELIBS = -lfontconfig -lXft +FREETYPEINC = /usr/include/freetype2 -all: options dmenubar +# OpenBSD (uncomment) +#FREETYPEINC = $(X11INC)/freetype2 -options: +CFLAGS = \ + -std=c99 \ + -pedantic \ + -Wall \ + -Os \ + -I$(X11INC) \ + -I$(FREETYPEINC) \ + -D_DEFAULT_SOURCE \ + -D_BSD_SOURCE \ + -D_XOPEN_SOURCE=700 \ + -D_POSIX_C_SOURCE=200809L \ + $(XINERAMAFLAGS) + +LDFLAGS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) + +dmenubar: config.h dmenubar.o drw.h drw.o util.o @echo dmenu build options: @echo "CFLAGS = $(CFLAGS)" @echo "LDFLAGS = $(LDFLAGS)" @echo "CC = $(CC)" + $(CC) -o $@ dmenubar.o drw.o util.o $(LDFLAGS) .c.o: $(CC) -c $(CFLAGS) $< @@ -20,33 +40,7 @@ options: config.h: cp config.def.h $@ -$(OBJ): arg.h config.h config.mk drw.h - -dmenubar: dmenubar.o drw.o util.o - $(CC) -o $@ dmenubar.o drw.o util.o $(LDFLAGS) - clean: - rm -f dmenubar $(OBJ) dmenubar-$(VERSION).tar.gz + rm -f dmenubar *.o -dist: clean - mkdir -p dmenubar-$(VERSION) - cp LICENSE Makefile README arg.h config.def.h config.mk dmenubar.1\ - drw.h util.h $(SRC)\ - dmenubar-$(VERSION) - tar -cf dmenubar-$(VERSION).tar dmenubar-$(VERSION) - gzip dmenubar-$(VERSION).tar - rm -rf dmenubar-$(VERSION) - -install: all - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp -f dmenubar $(DESTDIR)$(PREFIX)/bin - chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenubar - mkdir -p $(DESTDIR)$(MANPREFIX)/man1 - sed "s/VERSION/$(VERSION)/g" < dmenubar.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenubar.1 - chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenubar.1 - -uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/dmenubar\ - $(DESTDIR)$(MANPREFIX)/man1/dmenubar.1\ - -.PHONY: all options clean dist install uninstall +.PHONY: clean diff --git a/dmenubar/arg.h b/dmenubar/arg.h deleted file mode 100644 index e94e02b..0000000 --- a/dmenubar/arg.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copy me if you can. - * by 20h - */ - -#ifndef ARG_H__ -#define ARG_H__ - -extern char *argv0; - -/* use main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ - argv[0] && argv[0][0] == '-'\ - && argv[0][1];\ - argc--, argv++) {\ - char argc_;\ - char **argv_;\ - int brk_;\ - if (argv[0][1] == '-' && argv[0][2] == '\0') {\ - argv++;\ - argc--;\ - break;\ - }\ - for (brk_ = 0, argv[0]++, argv_ = argv;\ - argv[0][0] && !brk_;\ - argv[0]++) {\ - if (argv_ != argv)\ - break;\ - argc_ = argv[0][0];\ - switch (argc_) - -#define ARGEND }\ - } - -#define ARGC() argc_ - -#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\ - ((x), abort(), (char *)0) :\ - (brk_ = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\ - (char *)0 :\ - (brk_ = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#endif diff --git a/dmenubar/config.mk b/dmenubar/config.mk deleted file mode 100644 index 05d5a3e..0000000 --- a/dmenubar/config.mk +++ /dev/null @@ -1,31 +0,0 @@ -# dmenu version -VERSION = 5.0 - -# paths -PREFIX = /usr/local -MANPREFIX = $(PREFIX)/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -#FREETYPEINC = $(X11INC)/freetype2 - -# includes and libs -INCS = -I$(X11INC) -I$(FREETYPEINC) -LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) - -# flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS) -CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS) -LDFLAGS = $(LIBS) - -# compiler and linker -CC = cc