1
0

trim down build

This commit is contained in:
dtb 2023-09-14 10:06:25 -04:00
parent 054063f2f3
commit 82a7dfc5f0
4 changed files with 30 additions and 116 deletions

View File

@ -10,7 +10,7 @@ MIT/X Consortium License
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
© 2014-2020 Hiltjo Posthuma <hiltjo@codemadness.org>
© 2015-2019 Quentin Rameau <quinq@fifth.space>
© 2021 Deven Blake <trinity@trinity.moe>
© 2021-2023 Deven Blake <trinity@trinity.moe>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

View File

@ -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

View File

@ -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

View File

@ -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