diff --git a/Makefile b/Makefile index 9e919dc8..3fd244fb 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,8 @@ CFLAGS += -Wall # Extended debugging flags, macros shall be available in gcc CFLAGS += -gdwarf-2 CFLAGS += -g3 -#CFLAGS += -I/usr/include/xcb +CFLAGS += -Iinclude CFLAGS += -I/usr/local/include/ -#CFLAGS += -I/usr/local/include/xcb CFLAGS += -I/usr/pkg/include LDFLAGS += -lxcb-wm @@ -18,13 +17,16 @@ ifeq ($(UNAME),NetBSD) LDFLAGS += -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/pkg/lib endif -FILES=$(patsubst %.c,%.o,$(wildcard *.c)) +FILES=$(patsubst %.c,%.o,$(wildcard src/*.c)) -%.o: %.c %.h data.h +src/%.o: src/%.c include/%.h include/data.h $(CC) $(CFLAGS) -c -o $@ $< all: ${FILES} - $(CC) -o mainx ${FILES} $(LDFLAGS) + $(CC) -o i3 ${FILES} $(LDFLAGS) clean: - rm -f *.o + rm -f src/*.o + +distclean: clean + rm -f i3 diff --git a/commands.h b/include/commands.h similarity index 100% rename from commands.h rename to include/commands.h diff --git a/data.h b/include/data.h similarity index 100% rename from data.h rename to include/data.h diff --git a/debug.h b/include/debug.h similarity index 100% rename from debug.h rename to include/debug.h diff --git a/font.h b/include/font.h similarity index 100% rename from font.h rename to include/font.h diff --git a/handlers.h b/include/handlers.h similarity index 100% rename from handlers.h rename to include/handlers.h diff --git a/i3.h b/include/i3.h similarity index 100% rename from i3.h rename to include/i3.h diff --git a/layout.h b/include/layout.h similarity index 100% rename from layout.h rename to include/layout.h diff --git a/queue.h b/include/queue.h similarity index 99% rename from queue.h rename to include/queue.h index 56d9c4af..75bb957a 100644 --- a/queue.h +++ b/include/queue.h @@ -36,7 +36,7 @@ #define _SYS_QUEUE_H_ /* - * This file defines five types of data structures: singly-linked lists, + * This file defines five types of data structures: singly-linked lists, * lists, simple queues, tail queues, and circular queues. * * @@ -95,15 +95,15 @@ struct name { \ struct type *slh_first; /* first element */ \ } - + #define SLIST_HEAD_INITIALIZER(head) \ { NULL } - + #define SLIST_ENTRY(type) \ struct { \ struct type *sle_next; /* next element */ \ } - + /* * Singly-linked List access methods. */ @@ -318,8 +318,8 @@ struct { \ struct type **tqe_prev; /* address of previous next element */ \ } -/* - * tail queue access methods +/* + * tail queue access methods */ #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_END(head) NULL @@ -426,7 +426,7 @@ struct { \ } /* - * Circular queue access methods + * Circular queue access methods */ #define CIRCLEQ_FIRST(head) ((head)->cqh_first) #define CIRCLEQ_LAST(head) ((head)->cqh_last) diff --git a/table.h b/include/table.h similarity index 100% rename from table.h rename to include/table.h diff --git a/util.h b/include/util.h similarity index 100% rename from util.h rename to include/util.h diff --git a/xcb.h b/include/xcb.h similarity index 100% rename from xcb.h rename to include/xcb.h diff --git a/commands.c b/src/commands.c similarity index 100% rename from commands.c rename to src/commands.c diff --git a/debug.c b/src/debug.c similarity index 100% rename from debug.c rename to src/debug.c diff --git a/font.c b/src/font.c similarity index 100% rename from font.c rename to src/font.c diff --git a/handlers.c b/src/handlers.c similarity index 100% rename from handlers.c rename to src/handlers.c diff --git a/layout.c b/src/layout.c similarity index 100% rename from layout.c rename to src/layout.c diff --git a/mainx.c b/src/mainx.c similarity index 100% rename from mainx.c rename to src/mainx.c diff --git a/table.c b/src/table.c similarity index 100% rename from table.c rename to src/table.c diff --git a/util.c b/src/util.c similarity index 100% rename from util.c rename to src/util.c diff --git a/xcb.c b/src/xcb.c similarity index 100% rename from xcb.c rename to src/xcb.c