-wmiistatus: wmiistatus.c wmiistatus.h config.h config.c Makefile
- gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -g -c -o wmiistatus.o wmiistatus.c
- gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -g -c -o config.o config.c
- gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -g -o wmiistatus *.o
+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
+CFLAGS+=-g
+CFLAGS+=-DPREFIX=\"\"
+
+wmiistatus: wmiistatus.o wmiistatus.h config.h config.o
+
+clean:
+ rm *.o
+
+distclean: clean
+ rm wmiistatus
install:
install -m 755 -d $(DESTDIR)/usr/bin
#include <arpa/inet.h>
#include <glob.h>
#include <dirent.h>
+#include <getopt.h>
#define _IS_WMIISTATUS_C
#include "wmiistatus.h"
return (stat(procbuf, &statbuf) >= 0);
}
-int main(void) {
+int main(int argc, char *argv[]) {
char part[512],
pathbuf[512],
*end;
unsigned int i;
- load_configuration("/etc/wmiistatus.conf");
+ char *configfile = PREFIX "/etc/wmiistatus.conf";
+ int o, option_index = 0;
+ struct option long_options[] = {
+ {"config", required_argument, 0, 'c'},
+ {0, 0, 0, 0}
+ };
+
+ while ((o = getopt_long(argc, argv, "c:", long_options, &option_index)) != -1)
+ if ((char)o == 'c')
+ configfile = optarg;
+
+ load_configuration(configfile);
cleanup_rbar_dir();
if (wlan_interface)
create_file(concat(order[ORDER_WLAN],"wlan"));