summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorswindlesmccoop <swindlesmccoop@waifu.club>2022-10-03 15:35:03 -0400
committerswindlesmccoop <swindlesmccoop@waifu.club>2022-10-03 15:35:03 -0400
commitd551bc9d19cdbf173692b31b8da46ed7e0332cd2 (patch)
tree95535640354a03982211363a9b68f2acdcc2ae44
parentaa4b0bea3f196899da97874302a86021811bb97a (diff)
Update configuration method
-rw-r--r--Makefile5
-rwxr-xr-xconfigure32
-rw-r--r--makefiles/Makefile.freebsd30
-rw-r--r--makefiles/Makefile.linux28
-rw-r--r--makefiles/Makefile.openbsd30
5 files changed, 107 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index c71f933..efbbde0 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,6 @@ CC := cc
CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os
LDFLAGS := -lX11
-# FreeBSD (uncomment)
-#LDFLAGS += -L/usr/local/lib -I/usr/local/include
-# # OpenBSD (uncomment)
-#LDFLAGS += -L/usr/X11R6/lib -I/usr/X11R6/include
-
all: options dwmblocks
options:
diff --git a/configure b/configure
index 0f09ce0..890b7bc 100755
--- a/configure
+++ b/configure
@@ -1,17 +1,23 @@
#!/bin/sh
OS=$(uname)
-sed -i 's/##/#/g' Makefile
-sed -i '7 s/^/#/' Makefile
-sed -i '9 s/^/#/' Makefile
-sed -i 's/##/#/g' Makefile
+case $OS in
+ Linux) cp -f makefiles/Makefile.linux Makefile ;;
+ OpenBSD) cp -f makefiles/Makefile.openbsd Makefile ;;
+ FreeBSD) cp -f makefiles/Makefile.freebsd Makefile ;;
+esac
-if [ "$OS" = "Linux " ]; then
- true
-else if [ "$OS" = "FreeBSD" ]; then
- sed -i '7 s/.//' Makefile
-else if [ "$OS" = "OpenBSD" ]; then
- sed -i '9 s/.//' Makefile
-fi
-fi
-fi \ No newline at end of file
+#sed -i 's/##/#/g' Makefile
+#sed -i '7 s/^/#/' Makefile
+#sed -i '9 s/^/#/' Makefile
+#sed -i 's/##/#/g' Makefile
+#
+#if [ "$OS" = "Linux " ]; then
+# true
+#else if [ "$OS" = "FreeBSD" ]; then
+# sed -i '7 s/.//' Makefile
+#else if [ "$OS" = "OpenBSD" ]; then
+# sed -i '9 s/.//' Makefile
+#fi
+#fi
+#fi \ No newline at end of file
diff --git a/makefiles/Makefile.freebsd b/makefiles/Makefile.freebsd
new file mode 100644
index 0000000..4d60375
--- /dev/null
+++ b/makefiles/Makefile.freebsd
@@ -0,0 +1,30 @@
+PREFIX := /usr/local
+CC := cc
+CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os
+LDFLAGS := -lX11
+
+LDFLAGS += -L/usr/local/lib -I/usr/local/include
+
+all: options dwmblocks
+
+options:
+ @echo dwmblocks build options:
+ @echo "CFLAGS = ${CFLAGS}"
+ @echo "LDFLAGS = ${LDFLAGS}"
+ @echo "CC = ${CC}"
+
+dwmblocks: dwmblocks.c blocks.h
+ ${CC} -o dwmblocks dwmblocks.c ${CFLAGS} ${LDFLAGS}
+
+clean:
+ rm -f *.o *.gch dwmblocks
+
+install: dwmblocks
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ cp -f dwmblocks ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/dwmblocks
+
+uninstall:
+ rm -f ${DESTDIR}${PREFIX}/bin/dwmblocks
+
+.PHONY: all options clean install uninstall
diff --git a/makefiles/Makefile.linux b/makefiles/Makefile.linux
new file mode 100644
index 0000000..efbbde0
--- /dev/null
+++ b/makefiles/Makefile.linux
@@ -0,0 +1,28 @@
+PREFIX := /usr/local
+CC := cc
+CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os
+LDFLAGS := -lX11
+
+all: options dwmblocks
+
+options:
+ @echo dwmblocks build options:
+ @echo "CFLAGS = ${CFLAGS}"
+ @echo "LDFLAGS = ${LDFLAGS}"
+ @echo "CC = ${CC}"
+
+dwmblocks: dwmblocks.c blocks.h
+ ${CC} -o dwmblocks dwmblocks.c ${CFLAGS} ${LDFLAGS}
+
+clean:
+ rm -f *.o *.gch dwmblocks
+
+install: dwmblocks
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ cp -f dwmblocks ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/dwmblocks
+
+uninstall:
+ rm -f ${DESTDIR}${PREFIX}/bin/dwmblocks
+
+.PHONY: all options clean install uninstall
diff --git a/makefiles/Makefile.openbsd b/makefiles/Makefile.openbsd
new file mode 100644
index 0000000..d6198e1
--- /dev/null
+++ b/makefiles/Makefile.openbsd
@@ -0,0 +1,30 @@
+PREFIX := /usr/local
+CC := cc
+CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os
+LDFLAGS := -lX11
+
+LDFLAGS += -L/usr/X11R6/lib -I/usr/X11R6/include
+
+all: options dwmblocks
+
+options:
+ @echo dwmblocks build options:
+ @echo "CFLAGS = ${CFLAGS}"
+ @echo "LDFLAGS = ${LDFLAGS}"
+ @echo "CC = ${CC}"
+
+dwmblocks: dwmblocks.c blocks.h
+ ${CC} -o dwmblocks dwmblocks.c ${CFLAGS} ${LDFLAGS}
+
+clean:
+ rm -f *.o *.gch dwmblocks
+
+install: dwmblocks
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ cp -f dwmblocks ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/dwmblocks
+
+uninstall:
+ rm -f ${DESTDIR}${PREFIX}/bin/dwmblocks
+
+.PHONY: all options clean install uninstall