[improve] Move the makefile into the prolect scope
This commit is contained in:
parent
a86f296efc
commit
f3b2844966
4 changed files with 494 additions and 16 deletions
62
src/Makefile
62
src/Makefile
|
@ -1,62 +0,0 @@
|
|||
# dwm - dynamic window manager
|
||||
# See LICENSE file for copyright and license details.
|
||||
|
||||
include config.mk
|
||||
|
||||
SRC = drw.c yo_dwm.c util.c
|
||||
OBJ = ${SRC:.c=.o}
|
||||
|
||||
all: options yo-dwm
|
||||
|
||||
options:
|
||||
@echo yo-dwm build options:
|
||||
@echo "CFLAGS = ${CFLAGS}"
|
||||
@echo "LDFLAGS = ${LDFLAGS}"
|
||||
@echo "CC = ${CC}"
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CFLAGS} $<
|
||||
|
||||
${OBJ}: config.h config.mk
|
||||
|
||||
config.h:
|
||||
cp config.def.h $@
|
||||
|
||||
yo-dwm: ${OBJ}
|
||||
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
|
||||
clean:
|
||||
rm -f yo-dwm ${OBJ} yo-dwm_${VERSION}.tar.gz
|
||||
|
||||
dist: clean
|
||||
mkdir -p yo-dwm_${VERSION}
|
||||
cp -R LICENSE Makefile README config.def.h config.mk\
|
||||
yo-dwm.1 drw.h util.h ${SRC} dwm.png transient.c yo-dwm_${VERSION}
|
||||
tar -cf yo-dwm_${VERSION}.tar yo-dwm_${VERSION}
|
||||
gzip yo-dwm_${VERSION}.tar
|
||||
rm -rf yo-dwm_${VERSION}
|
||||
|
||||
install: all
|
||||
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
cp -f yo-dwm ${DESTDIR}${PREFIX}/bin
|
||||
chmod 755 ${DESTDIR}${PREFIX}/bin/yo-dwm
|
||||
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
sed "s/VERSION/${VERSION}/g" < ../yo-dwm.1 > ${DESTDIR}${MANPREFIX}/man1/yo-dwm.1
|
||||
chmod 644 ${DESTDIR}${MANPREFIX}/man1/yo-dwm.1
|
||||
|
||||
desktop:
|
||||
full_path=/usr/share/xsessions/yo-dwm.desktop
|
||||
mkdir -p /usr/share/xsessions
|
||||
cat <<EOT >> ${full_path}
|
||||
[Desktop Entry]
|
||||
Type=XSession
|
||||
Exec=/usr/local/bin/yo-dwm
|
||||
DesktopNames=yo-dwm
|
||||
Name=yo-dwm
|
||||
Comment=Anas Elgarhy's dwm fork, with a lot of beautiful patches
|
||||
|
||||
uninstall:
|
||||
rm -f ${DESTDIR}${PREFIX}/bin/yo-dwm\
|
||||
${DESTDIR}${MANPREFIX}/man1/yo-dwm.1
|
||||
|
||||
.PHONY: all options clean dist install uninstall
|
|
@ -1,39 +0,0 @@
|
|||
# yo-dwm version
|
||||
VERSION = 6.4-0.2.1
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
# 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
|
||||
#MANPREFIX = ${PREFIX}/man
|
||||
|
||||
# includes and libs
|
||||
INCS = -I${X11INC} -I${FREETYPEINC}
|
||||
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
|
||||
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS = ${LIBS}
|
||||
|
||||
# Solaris
|
||||
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
|
||||
#LDFLAGS = ${LIBS}
|
||||
|
||||
# compiler and linker
|
||||
CC = cc
|
Loading…
Add table
Add a link
Reference in a new issue