diff --git a/Makefile b/Makefile index 188218e..44ba7f9 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ MODULES_SRC = \ src/atoms.c \ src/constraints.c \ src/drw.c \ + src/dwm.c \ src/helpers.c \ src/layouts.c \ src/settings.c \ @@ -37,7 +38,7 @@ DWM_SRC = \ MODULES_HDR = $(MODULES_SRC:.c=.h) DWM_HDR = $(DWM_SRC:.c=.h) -SRC = $(MODULES_SRC) src/dwm.c +SRC = $(MODULES_SRC) src/main.c HDR = $(MODULES_HDR) src/config.def.h OBJ = $(SRC:.c=.o) diff --git a/src/dwm.c b/src/dwm.c index 4efd517..c2bc83c 100644 --- a/src/dwm.c +++ b/src/dwm.c @@ -1,3 +1,5 @@ +#include "dwm.h" + #include "atoms.h" #include "helpers.h" #include "layouts.h" @@ -274,7 +276,7 @@ static void (*handler[LASTEvent])(XEvent*) = { #include "dwm/layouts.c" #include "dwm/xerror.c" -int main(int argc, char *argv[]) +int dwm_main(int argc, char *argv[]) { if (argc == 2 && !strcmp("-v", argv[1])) { die("polytreewm-"VERSION); diff --git a/src/dwm.h b/src/dwm.h new file mode 100644 index 0000000..051fdfe --- /dev/null +++ b/src/dwm.h @@ -0,0 +1,6 @@ +#ifndef _DWM_H +#define _DWM_H + +int dwm_main(int argc, char *argv[]); + +#endif // _DWM_H diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..85001c1 --- /dev/null +++ b/src/main.c @@ -0,0 +1,6 @@ +#include "dwm.h" + +int main(int argc, char *argv[]) +{ + return dwm_main(argc, argv); +}