aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile14
-rw-r--r--config.mk4
-rw-r--r--test.c2
4 files changed, 16 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index dfc3571..52de4a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
*\#*
*~
*.o
+*.su
/test
diff --git a/Makefile b/Makefile
index df46d2b..515e737 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,15 @@
CONFIGFILE = config.mk
include $(CONFIGFILE)
+
all: test
+test.o: binary-multisearch.h
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
-test: test.c binary-multisearch.h
- $(CC) -o $@ test.c $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
+.o:
+ $(CC) -o $@ $< $(LDFLAGS)
check: test
./test
@@ -19,6 +24,9 @@ uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/include/binary-multisearch.h"
clean:
- -rm -f -- *.o test
+ -rm -f -- *.o *.su test
+
+.SUFFIXES:
+.SUFFIXES: .o .c
.PHONY: all check install uninstall clean
diff --git a/config.mk b/config.mk
index 868c124..5ebe114 100644
--- a/config.mk
+++ b/config.mk
@@ -2,4 +2,6 @@ PREFIX = /usr
CC = cc
-CFLAGS = -std=c99 -Wall
+CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
+CFLAGS = -std=c99 -Wall -g
+LDFLAGS =
diff --git a/test.c b/test.c
index f38bb99..986488a 100644
--- a/test.c
+++ b/test.c
@@ -1,4 +1,4 @@
-#define _GNU_SOURCE
+/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>