From 8d656ccb489778a384d9f828ed4ad69f7e28b64c Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Tue, 16 Nov 2021 22:35:13 +0500 Subject: [PATCH] Move all source code to "src/" directory --- .gitignore | 3 +-- Makefile | 43 ++++++++++++++++++++++++++------ atoms.c => src/atoms.c | 0 atoms.h => src/atoms.h | 0 config.def.h => src/config.def.h | 0 config.h => src/config.h | 0 drw.c => src/drw.c | 0 drw.h => src/drw.h | 0 dwm.c => src/dwm.c | 0 {dwm => src/dwm}/handlers.c | 0 {dwm => src/dwm}/handlers.h | 0 {dwm => src/dwm}/layouts.c | 0 {dwm => src/dwm}/layouts.h | 0 {dwm => src/dwm}/swallow.c | 0 {dwm => src/dwm}/swallow.h | 0 {dwm => src/dwm}/systray.c | 0 {dwm => src/dwm}/systray.h | 0 helpers.c => src/helpers.c | 0 helpers.h => src/helpers.h | 0 layouts.c => src/layouts.c | 0 layouts.h => src/layouts.h | 0 menu.c => src/menu.c | 0 menu.h => src/menu.h | 0 settings.c => src/settings.c | 0 settings.h => src/settings.h | 0 spawn.c => src/spawn.c | 0 spawn.h => src/spawn.h | 0 tags.c => src/tags.c | 0 tags.h => src/tags.h | 0 util.c => src/util.c | 0 util.h => src/util.h | 0 31 files changed, 36 insertions(+), 10 deletions(-) rename atoms.c => src/atoms.c (100%) rename atoms.h => src/atoms.h (100%) rename config.def.h => src/config.def.h (100%) rename config.h => src/config.h (100%) rename drw.c => src/drw.c (100%) rename drw.h => src/drw.h (100%) rename dwm.c => src/dwm.c (100%) rename {dwm => src/dwm}/handlers.c (100%) rename {dwm => src/dwm}/handlers.h (100%) rename {dwm => src/dwm}/layouts.c (100%) rename {dwm => src/dwm}/layouts.h (100%) rename {dwm => src/dwm}/swallow.c (100%) rename {dwm => src/dwm}/swallow.h (100%) rename {dwm => src/dwm}/systray.c (100%) rename {dwm => src/dwm}/systray.h (100%) rename helpers.c => src/helpers.c (100%) rename helpers.h => src/helpers.h (100%) rename layouts.c => src/layouts.c (100%) rename layouts.h => src/layouts.h (100%) rename menu.c => src/menu.c (100%) rename menu.h => src/menu.h (100%) rename settings.c => src/settings.c (100%) rename settings.h => src/settings.h (100%) rename spawn.c => src/spawn.c (100%) rename spawn.h => src/spawn.h (100%) rename tags.c => src/tags.c (100%) rename tags.h => src/tags.h (100%) rename util.c => src/util.c (100%) rename util.h => src/util.h (100%) diff --git a/.gitignore b/.gitignore index d0c9f19..651dd4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -*.o - /polytreewm +/src/*.o diff --git a/Makefile b/Makefile index e08c808..0e5b1a6 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,37 @@ include config.mk -SRC = atoms.c drw.c dwm.c helpers.c layouts.c menu.c settings.c spawn.c tags.c util.c -OBJ = ${SRC:.c=.o} +SRC = \ + src/atoms.c \ + src/drw.c \ + src/dwm.c \ + src/helpers.c \ + src/layouts.c \ + src/menu.c \ + src/settings.c \ + src/spawn.c \ + src/tags.c \ + src/util.c -DWM_SRC = dwm/handlers.c dwm/layouts.c dwm/swallow.c dwm/systray.c +HDR = \ + src/atoms.h \ + src/drw.h \ + src/config.def.h \ + src/helpers.h \ + src/layouts.h \ + src/menu.h \ + src/settings.h \ + src/spawn.h \ + src/tags.h \ + src/util.h + +DWM_SRC = \ + src/dwm/handlers.c \ + src/dwm/layouts.c \ + src/dwm/swallow.c \ + src/dwm/systray.c + +OBJ = ${SRC:.c=.o} DWM_HDR = ${DWM_SRC:.c=.h} all: options polytreewm @@ -17,17 +44,17 @@ options: @echo "LDFLAGS = ${LDFLAGS}" @echo "CC = ${CC}" +polytreewm: ${OBJ} + ${CC} -o $@ ${OBJ} ${LDFLAGS} + %.o: %.c ${CC} -c $< -o $@ ${CFLAGS} dwm.o: ${DWM_SRC} ${DWM_HDR} -${OBJ}: atoms.h drw.h config.def.h config.mk helpers.h layouts.h menu.h settings.h spawn.h tags.h util.h - -polytreewm: ${OBJ} - ${CC} -o $@ ${OBJ} ${LDFLAGS} +${OBJ}: config.mk ${HDR} clean: - rm -f polytreewm ${OBJ} polytreewm-${VERSION}.tar.gz + rm -f polytreewm ${OBJ} install: all mkdir -p ${DESTDIR}${PREFIX}/bin diff --git a/atoms.c b/src/atoms.c similarity index 100% rename from atoms.c rename to src/atoms.c diff --git a/atoms.h b/src/atoms.h similarity index 100% rename from atoms.h rename to src/atoms.h diff --git a/config.def.h b/src/config.def.h similarity index 100% rename from config.def.h rename to src/config.def.h diff --git a/config.h b/src/config.h similarity index 100% rename from config.h rename to src/config.h diff --git a/drw.c b/src/drw.c similarity index 100% rename from drw.c rename to src/drw.c diff --git a/drw.h b/src/drw.h similarity index 100% rename from drw.h rename to src/drw.h diff --git a/dwm.c b/src/dwm.c similarity index 100% rename from dwm.c rename to src/dwm.c diff --git a/dwm/handlers.c b/src/dwm/handlers.c similarity index 100% rename from dwm/handlers.c rename to src/dwm/handlers.c diff --git a/dwm/handlers.h b/src/dwm/handlers.h similarity index 100% rename from dwm/handlers.h rename to src/dwm/handlers.h diff --git a/dwm/layouts.c b/src/dwm/layouts.c similarity index 100% rename from dwm/layouts.c rename to src/dwm/layouts.c diff --git a/dwm/layouts.h b/src/dwm/layouts.h similarity index 100% rename from dwm/layouts.h rename to src/dwm/layouts.h diff --git a/dwm/swallow.c b/src/dwm/swallow.c similarity index 100% rename from dwm/swallow.c rename to src/dwm/swallow.c diff --git a/dwm/swallow.h b/src/dwm/swallow.h similarity index 100% rename from dwm/swallow.h rename to src/dwm/swallow.h diff --git a/dwm/systray.c b/src/dwm/systray.c similarity index 100% rename from dwm/systray.c rename to src/dwm/systray.c diff --git a/dwm/systray.h b/src/dwm/systray.h similarity index 100% rename from dwm/systray.h rename to src/dwm/systray.h diff --git a/helpers.c b/src/helpers.c similarity index 100% rename from helpers.c rename to src/helpers.c diff --git a/helpers.h b/src/helpers.h similarity index 100% rename from helpers.h rename to src/helpers.h diff --git a/layouts.c b/src/layouts.c similarity index 100% rename from layouts.c rename to src/layouts.c diff --git a/layouts.h b/src/layouts.h similarity index 100% rename from layouts.h rename to src/layouts.h diff --git a/menu.c b/src/menu.c similarity index 100% rename from menu.c rename to src/menu.c diff --git a/menu.h b/src/menu.h similarity index 100% rename from menu.h rename to src/menu.h diff --git a/settings.c b/src/settings.c similarity index 100% rename from settings.c rename to src/settings.c diff --git a/settings.h b/src/settings.h similarity index 100% rename from settings.h rename to src/settings.h diff --git a/spawn.c b/src/spawn.c similarity index 100% rename from spawn.c rename to src/spawn.c diff --git a/spawn.h b/src/spawn.h similarity index 100% rename from spawn.h rename to src/spawn.h diff --git a/tags.c b/src/tags.c similarity index 100% rename from tags.c rename to src/tags.c diff --git a/tags.h b/src/tags.h similarity index 100% rename from tags.h rename to src/tags.h diff --git a/util.c b/src/util.c similarity index 100% rename from util.c rename to src/util.c diff --git a/util.h b/src/util.h similarity index 100% rename from util.h rename to src/util.h