Browse code

Version 1.1

John Hawthorn authored on 12/07/2025 06:54:23
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=1.0
1
+VERSION=1.1
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-MD -Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps -Werror=vla
Browse code

Add missing Make dependencies

Thodoris Sotiropoulos authored on 04/01/2020 22:50:06
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 VERSION=1.0
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4
-CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps -Werror=vla
4
+CFLAGS+=-MD -Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps -Werror=vla
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
7 7
 BINDIR?=$(PREFIX)/bin
... ...
@@ -49,9 +49,11 @@ fmt:
49 49
 	clang-format -i src/*.c src/*.h
50 50
 
51 51
 clean:
52
-	rm -f fzy test/fzytest src/*.o deps/*/*.o
52
+	rm -f fzy test/fzytest src/*.o src/*.d deps/*/*.o
53 53
 
54 54
 veryclean: clean
55 55
 	rm -f config.h
56 56
 
57 57
 .PHONY: test check all clean veryclean install fmt acceptance
58
+
59
+-include $(OBJECTS:.o=.d)
Browse code

Error on usage of VLA

John Hawthorn authored on 28/12/2019 02:44:01
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 VERSION=1.0
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4
-CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps
4
+CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps -Werror=vla
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
7 7
 BINDIR?=$(PREFIX)/bin
Browse code

Rebuild config.h if config.def.h is newer

John Hawthorn authored on 14/01/2019 04:54:03
Showing 1 changed files
... ...
@@ -34,7 +34,7 @@ fzy: $(OBJECTS)
34 34
 %.o: %.c config.h
35 35
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
36 36
 
37
-config.h:
37
+config.h: src/config.def.h
38 38
 	cp src/config.def.h config.h
39 39
 
40 40
 install: fzy
Browse code

Version 1.0

John Hawthorn authored on 23/09/2018 21:17:22
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.9
1
+VERSION=1.0
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps
Browse code

bundle quietly

John Hawthorn authored on 09/09/2018 08:09:41
Showing 1 changed files
... ...
@@ -22,7 +22,7 @@ test/fzytest: $(TESTOBJECTS)
22 22
 	$(CC) $(CFLAGS) $(CCFLAGS) -Isrc -o $@ $(TESTOBJECTS) $(LIBS)
23 23
 
24 24
 acceptance: fzy
25
-	cd test/acceptance && bundle && bundle exec ruby acceptance_test.rb
25
+	cd test/acceptance && bundle --quiet && bundle exec ruby acceptance_test.rb
26 26
 
27 27
 test: check
28 28
 check: test/fzytest
Browse code

Version 0.9

John Hawthorn authored on 17/04/2017 07:55:42
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.8
1
+VERSION=0.9
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps
Browse code

Clean .o from deps in make clean

John Hawthorn authored on 05/04/2017 06:42:01
Showing 1 changed files
... ...
@@ -49,7 +49,7 @@ fmt:
49 49
 	clang-format -i src/*.c src/*.h
50 50
 
51 51
 clean:
52
-	rm -f fzy test/fzytest src/*.o
52
+	rm -f fzy test/fzytest src/*.o deps/*/*.o
53 53
 
54 54
 veryclean: clean
55 55
 	rm -f config.h
Browse code

Move test suites into separate files

John Hawthorn authored on 05/04/2017 05:52:53
Showing 1 changed files
... ...
@@ -14,7 +14,7 @@ INSTALL_DATA=${INSTALL} -m 644
14 14
 LIBS=-lpthread
15 15
 OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o src/options.o src/tty_interface.o
16 16
 THEFTDEPS = deps/theft/theft.o deps/theft/theft_bloom.o deps/theft/theft_mt.o deps/theft/theft_hash.o
17
-TESTOBJECTS=test/fzytest.c test/test_properties.c src/match.o src/choices.o src/options.o $(THEFTDEPS)
17
+TESTOBJECTS=test/fzytest.c test/test_properties.c test/test_choices.c test/test_match.c src/match.o src/choices.o src/options.o $(THEFTDEPS)
18 18
 
19 19
 all: fzy
20 20
 
Browse code

Add theft

John Hawthorn authored on 03/04/2017 09:11:20
Showing 1 changed files
... ...
@@ -13,7 +13,8 @@ INSTALL_DATA=${INSTALL} -m 644
13 13
 
14 14
 LIBS=-lpthread
15 15
 OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o src/options.o src/tty_interface.o
16
-TESTOBJECTS=test/fzytest.c src/match.o src/choices.o src/options.o
16
+THEFTDEPS = deps/theft/theft.o deps/theft/theft_bloom.o deps/theft/theft_mt.o deps/theft/theft_hash.o
17
+TESTOBJECTS=test/fzytest.c test/test_properties.c src/match.o src/choices.o src/options.o $(THEFTDEPS)
17 18
 
18 19
 all: fzy
19 20
 
Browse code

Add greatest test lib

John Hawthorn authored on 03/04/2017 05:24:41
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 VERSION=0.8
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4
-CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
4
+CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
7 7
 BINDIR?=$(PREFIX)/bin
Browse code

Pass options to choices_init

John Hawthorn authored on 01/02/2017 02:06:42
Showing 1 changed files
... ...
@@ -13,7 +13,7 @@ INSTALL_DATA=${INSTALL} -m 644
13 13
 
14 14
 LIBS=-lpthread
15 15
 OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o src/options.o src/tty_interface.o
16
-TESTOBJECTS=test/fzytest.c src/match.o src/choices.o
16
+TESTOBJECTS=test/fzytest.c src/match.o src/choices.o src/options.o
17 17
 
18 18
 all: fzy
19 19
 
Browse code

Version 0.8

John Hawthorn authored on 01/01/2017 12:33:41
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.7
1
+VERSION=0.8
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
Browse code

Rename acceptance test

John Hawthorn authored on 31/12/2016 02:13:06
Showing 1 changed files
... ...
@@ -20,8 +20,8 @@ all: fzy
20 20
 test/fzytest: $(TESTOBJECTS)
21 21
 	$(CC) $(CFLAGS) $(CCFLAGS) -Isrc -o $@ $(TESTOBJECTS) $(LIBS)
22 22
 
23
-integration_test: fzy
24
-	cd test/integration && bundle && bundle exec ruby integration_test.rb
23
+acceptance: fzy
24
+	cd test/acceptance && bundle && bundle exec ruby acceptance_test.rb
25 25
 
26 26
 test: check
27 27
 check: test/fzytest
... ...
@@ -53,4 +53,4 @@ clean:
53 53
 veryclean: clean
54 54
 	rm -f config.h
55 55
 
56
-.PHONY: test check all clean veryclean install fmt integration_test
56
+.PHONY: test check all clean veryclean install fmt acceptance
Browse code

Add integration test helper to Makefile

John Hawthorn authored on 28/12/2016 08:48:09
Showing 1 changed files
... ...
@@ -20,6 +20,9 @@ all: fzy
20 20
 test/fzytest: $(TESTOBJECTS)
21 21
 	$(CC) $(CFLAGS) $(CCFLAGS) -Isrc -o $@ $(TESTOBJECTS) $(LIBS)
22 22
 
23
+integration_test: fzy
24
+	cd test/integration && bundle && bundle exec ruby integration_test.rb
25
+
23 26
 test: check
24 27
 check: test/fzytest
25 28
 	$(DEBUGGER) ./test/fzytest
... ...
@@ -50,4 +53,4 @@ clean:
50 53
 veryclean: clean
51 54
 	rm -f config.h
52 55
 
53
-.PHONY: test check all clean veryclean install fmt
56
+.PHONY: test check all clean veryclean install fmt integration_test
Browse code

Version 0.7

John Hawthorn authored on 04/08/2016 06:54:51
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.6
1
+VERSION=0.7
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
Browse code

Version 0.6

John Hawthorn authored on 27/07/2016 01:53:26
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.5
1
+VERSION=0.6
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
Browse code

Add make veryclean

John Hawthorn authored on 28/06/2016 06:03:25
Showing 1 changed files
... ...
@@ -47,4 +47,7 @@ fmt:
47 47
 clean:
48 48
 	rm -f fzy test/fzytest src/*.o
49 49
 
50
-.PHONY: test check all clean install fmt
50
+veryclean: clean
51
+	rm -f config.h
52
+
53
+.PHONY: test check all clean veryclean install fmt
Browse code

Use threading when matching/scoring

John Hawthorn authored on 18/06/2016 05:56:38
Showing 1 changed files
... ...
@@ -11,20 +11,21 @@ INSTALL=install
11 11
 INSTALL_PROGRAM=$(INSTALL)
12 12
 INSTALL_DATA=${INSTALL} -m 644
13 13
 
14
+LIBS=-lpthread
14 15
 OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o src/options.o src/tty_interface.o
15 16
 TESTOBJECTS=test/fzytest.c src/match.o src/choices.o
16 17
 
17 18
 all: fzy
18 19
 
19 20
 test/fzytest: $(TESTOBJECTS)
20
-	$(CC) $(CFLAGS) $(CCFLAGS) -Isrc -o $@ $(TESTOBJECTS)
21
+	$(CC) $(CFLAGS) $(CCFLAGS) -Isrc -o $@ $(TESTOBJECTS) $(LIBS)
21 22
 
22 23
 test: check
23 24
 check: test/fzytest
24 25
 	$(DEBUGGER) ./test/fzytest
25 26
 
26 27
 fzy: $(OBJECTS)
27
-	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $(OBJECTS)
28
+	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $(OBJECTS) $(LIBS)
28 29
 
29 30
 %.o: %.c config.h
30 31
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
Browse code

Extract tty interface to own file

John Hawthorn authored on 20/06/2016 06:08:00
Showing 1 changed files
... ...
@@ -11,7 +11,7 @@ INSTALL=install
11 11
 INSTALL_PROGRAM=$(INSTALL)
12 12
 INSTALL_DATA=${INSTALL} -m 644
13 13
 
14
-OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o src/options.o
14
+OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o src/options.o src/tty_interface.o
15 15
 TESTOBJECTS=test/fzytest.c src/match.o src/choices.o
16 16
 
17 17
 all: fzy
Browse code

Extract option parsing to separate file

John Hawthorn authored on 20/06/2016 01:03:47
Showing 1 changed files
... ...
@@ -11,7 +11,7 @@ INSTALL=install
11 11
 INSTALL_PROGRAM=$(INSTALL)
12 12
 INSTALL_DATA=${INSTALL} -m 644
13 13
 
14
-OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o
14
+OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o src/options.o
15 15
 TESTOBJECTS=test/fzytest.c src/match.o src/choices.o
16 16
 
17 17
 all: fzy
Browse code

Version 0.5

John Hawthorn authored on 12/06/2016 03:35:08
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.4
1
+VERSION=0.5
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
Browse code

Move fzytest into test/ directory

John Hawthorn authored on 21/05/2016 22:00:39
Showing 1 changed files
... ...
@@ -12,16 +12,16 @@ INSTALL_PROGRAM=$(INSTALL)
12 12
 INSTALL_DATA=${INSTALL} -m 644
13 13
 
14 14
 OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o
15
-TESTOBJECTS=src/fzytest.o src/match.o src/choices.o
15
+TESTOBJECTS=test/fzytest.c src/match.o src/choices.o
16 16
 
17 17
 all: fzy
18 18
 
19
-fzytest: $(TESTOBJECTS)
20
-	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $(TESTOBJECTS)
19
+test/fzytest: $(TESTOBJECTS)
20
+	$(CC) $(CFLAGS) $(CCFLAGS) -Isrc -o $@ $(TESTOBJECTS)
21 21
 
22 22
 test: check
23
-check: fzytest
24
-	$(DEBUGGER) ./fzytest
23
+check: test/fzytest
24
+	$(DEBUGGER) ./test/fzytest
25 25
 
26 26
 fzy: $(OBJECTS)
27 27
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $(OBJECTS)
... ...
@@ -44,6 +44,6 @@ fmt:
44 44
 	clang-format -i src/*.c src/*.h
45 45
 
46 46
 clean:
47
-	rm -f fzy fzytest src/*.o
47
+	rm -f fzy test/fzytest src/*.o
48 48
 
49 49
 .PHONY: test check all clean install fmt
Browse code

Move sources into src directory

John Hawthorn authored on 21/05/2016 21:56:03
Showing 1 changed files
... ...
@@ -11,8 +11,8 @@ INSTALL=install
11 11
 INSTALL_PROGRAM=$(INSTALL)
12 12
 INSTALL_DATA=${INSTALL} -m 644
13 13
 
14
-OBJECTS=fzy.o match.o tty.o choices.o
15
-TESTOBJECTS=fzytest.o match.o choices.o
14
+OBJECTS=src/fzy.o src/match.o src/tty.o src/choices.o
15
+TESTOBJECTS=src/fzytest.o src/match.o src/choices.o
16 16
 
17 17
 all: fzy
18 18
 
... ...
@@ -30,7 +30,7 @@ fzy: $(OBJECTS)
30 30
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
31 31
 
32 32
 config.h:
33
-	cp config.def.h config.h
33
+	cp src/config.def.h config.h
34 34
 
35 35
 install: fzy
36 36
 	mkdir -p $(DESTDIR)$(BINDIR)
... ...
@@ -41,9 +41,9 @@ install: fzy
41 41
 	chmod 644 ${DESTDIR}${MANDIR}/man1/fzy.1
42 42
 
43 43
 fmt:
44
-	clang-format -i *.c *.h
44
+	clang-format -i src/*.c src/*.h
45 45
 
46 46
 clean:
47
-	rm -f fzy fzytest *.o
47
+	rm -f fzy fzytest src/*.o
48 48
 
49 49
 .PHONY: test check all clean install fmt
Browse code

Version 0.4

John Hawthorn authored on 19/05/2016 15:59:51
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.3
1
+VERSION=0.4
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
Browse code

Fix permissions in make install

John Hawthorn authored on 19/05/2016 15:59:19
Showing 1 changed files
... ...
@@ -35,8 +35,10 @@ config.h:
35 35
 install: fzy
36 36
 	mkdir -p $(DESTDIR)$(BINDIR)
37 37
 	cp fzy $(DESTDIR)$(BINDIR)/
38
+	chmod 755 ${DESTDIR}${BINDIR}/fzy
38 39
 	mkdir -p $(DESTDIR)$(MANDIR)/man1
39 40
 	cp fzy.1 $(DESTDIR)$(MANDIR)/man1/
41
+	chmod 644 ${DESTDIR}${MANDIR}/man1/fzy.1
40 42
 
41 43
 fmt:
42 44
 	clang-format -i *.c *.h
Browse code

Partly revert Makefile compatibility

Apparently GNU make doesn't like adding dependencies on that style of
pattern rule specification.

This reverts part of 887a0b4294001c95187eeaeff20ad748125466d7

John Hawthorn authored on 26/04/2016 19:20:06
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ check: fzytest
26 26
 fzy: $(OBJECTS)
27 27
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $(OBJECTS)
28 28
 
29
-.c.o: config.h
29
+%.o: %.c config.h
30 30
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
31 31
 
32 32
 config.h:
Browse code

Improve Makefile compatibility

make now runs cleanly on default BSD make. This uglies it up a little,
but it was so close it might as well be made as widely compatible as
possible.

John Hawthorn authored on 26/04/2016 05:10:34
Showing 1 changed files
... ...
@@ -11,19 +11,22 @@ INSTALL=install
11 11
 INSTALL_PROGRAM=$(INSTALL)
12 12
 INSTALL_DATA=${INSTALL} -m 644
13 13
 
14
+OBJECTS=fzy.o match.o tty.o choices.o
15
+TESTOBJECTS=fzytest.o match.o choices.o
16
+
14 17
 all: fzy
15 18
 
16
-fzytest: fzytest.o match.o choices.o
17
-	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
19
+fzytest: $(TESTOBJECTS)
20
+	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $(TESTOBJECTS)
18 21
 
19 22
 test: check
20 23
 check: fzytest
21 24
 	$(DEBUGGER) ./fzytest
22 25
 
23
-fzy: fzy.o match.o tty.o choices.o
24
-	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
26
+fzy: $(OBJECTS)
27
+	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $(OBJECTS)
25 28
 
26
-%.o: %.c config.h
29
+.c.o: config.h
27 30
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
28 31
 
29 32
 config.h:
... ...
@@ -39,6 +42,6 @@ fmt:
39 42
 	clang-format -i *.c *.h
40 43
 
41 44
 clean:
42
-	$(RM) fzy fzytest *.o
45
+	rm -f fzy fzytest *.o
43 46
 
44 47
 .PHONY: test check all clean install fmt
Browse code

Add make check

John Hawthorn authored on 26/04/2016 04:43:08
Showing 1 changed files
... ...
@@ -16,7 +16,8 @@ all: fzy
16 16
 fzytest: fzytest.o match.o choices.o
17 17
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
18 18
 
19
-test: fzytest
19
+test: check
20
+check: fzytest
20 21
 	$(DEBUGGER) ./fzytest
21 22
 
22 23
 fzy: fzy.o match.o tty.o choices.o
... ...
@@ -40,4 +41,4 @@ fmt:
40 41
 clean:
41 42
 	$(RM) fzy fzytest *.o
42 43
 
43
-.PHONY: test all clean install fmt
44
+.PHONY: test check all clean install fmt
Browse code

Version 0.3

John Hawthorn authored on 26/04/2016 03:28:42
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.2
1
+VERSION=0.3
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
Browse code

Don't ignore make test errors

John Hawthorn authored on 24/04/2016 23:12:07
Showing 1 changed files
... ...
@@ -17,7 +17,7 @@ fzytest: fzytest.o match.o choices.o
17 17
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
18 18
 
19 19
 test: fzytest
20
-	-$(DEBUGGER) ./fzytest
20
+	$(DEBUGGER) ./fzytest
21 21
 
22 22
 fzy: fzy.o match.o tty.o choices.o
23 23
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
Browse code

Revert "Simplify CFLAGS"

This reverts commit de53af7e70bdc352513cabd40dcb4872052b701b.

John Hawthorn authored on 13/04/2016 18:51:32
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 VERSION=0.2
2 2
 
3
-CPPFLAGS=-DVERSION=\"${VERSION}\"
4
-CFLAGS+=-Wall -Wextra -g -O3 -pedantic
3
+CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4
+CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
7 7
 BINDIR?=$(PREFIX)/bin
Browse code

Don't build fzytest as part of make all

John Hawthorn authored on 10/04/2016 23:03:16
Showing 1 changed files
... ...
@@ -11,7 +11,7 @@ INSTALL=install
11 11
 INSTALL_PROGRAM=$(INSTALL)
12 12
 INSTALL_DATA=${INSTALL} -m 644
13 13
 
14
-all: fzy fzytest
14
+all: fzy
15 15
 
16 16
 fzytest: fzytest.o match.o choices.o
17 17
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
Browse code

Simplify CFLAGS

John Hawthorn authored on 10/04/2016 19:53:48
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 VERSION=0.2
2 2
 
3
-CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4
-CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
3
+CPPFLAGS=-DVERSION=\"${VERSION}\"
4
+CFLAGS+=-Wall -Wextra -g -O3 -pedantic
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
7 7
 BINDIR?=$(PREFIX)/bin
Browse code

Allow customization of config.h via config.def.h

John Hawthorn authored on 07/11/2015 09:37:03
Showing 1 changed files
... ...
@@ -25,6 +25,9 @@ fzy: fzy.o match.o tty.o choices.o
25 25
 %.o: %.c config.h
26 26
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
27 27
 
28
+config.h:
29
+	cp config.def.h config.h
30
+
28 31
 install: fzy
29 32
 	mkdir -p $(DESTDIR)$(BINDIR)
30 33
 	cp fzy $(DESTDIR)$(BINDIR)/
Browse code

Apply clang-format to all files

Apologies that this uses my preferred formatting style: mostly the same
as Linux, but without a break between function and brace. Adds spaces in
a few places they weren't before.

John Hawthorn authored on 07/11/2015 05:45:02
Showing 1 changed files
... ...
@@ -31,7 +31,10 @@ install: fzy
31 31
 	mkdir -p $(DESTDIR)$(MANDIR)/man1
32 32
 	cp fzy.1 $(DESTDIR)$(MANDIR)/man1/
33 33
 
34
+fmt:
35
+	clang-format -i *.c *.h
36
+
34 37
 clean:
35 38
 	$(RM) fzy fzytest *.o
36 39
 
37
-.PHONY: test all clean install
40
+.PHONY: test all clean install fmt
Browse code

Version 0.2

John Hawthorn authored on 19/10/2014 23:55:02
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.2pre
1
+VERSION=0.2
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
Browse code

More portable make install

John Hawthorn authored on 27/09/2014 23:43:57
Showing 1 changed files
... ...
@@ -26,9 +26,10 @@ fzy: fzy.o match.o tty.o choices.o
26 26
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
27 27
 
28 28
 install: fzy
29
-	$(INSTALL_PROGRAM) fzy $(DESTDIR)$(BINDIR)/fzy
30
-	$(INSTALL_PROGRAM) -d $(DESTDIR)$(MANDIR)/man1
31
-	$(INSTALL_PROGRAM) fzy.1 $(DESTDIR)$(MANDIR)/man1/fzy.1
29
+	mkdir -p $(DESTDIR)$(BINDIR)
30
+	cp fzy $(DESTDIR)$(BINDIR)/
31
+	mkdir -p $(DESTDIR)$(MANDIR)/man1
32
+	cp fzy.1 $(DESTDIR)$(MANDIR)/man1/
32 33
 
33 34
 clean:
34 35
 	$(RM) fzy fzytest *.o
Browse code

Raise SIGTRAP on all assertion failures

Makes it easy to run tests w/ gdb for debugging

John Hawthorn authored on 27/09/2014 21:55:00
Showing 1 changed files
... ...
@@ -5,7 +5,7 @@ CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
7 7
 BINDIR?=$(PREFIX)/bin
8
-VALGRIND?=
8
+DEBUGGER?=
9 9
 
10 10
 INSTALL=install
11 11
 INSTALL_PROGRAM=$(INSTALL)
... ...
@@ -17,7 +17,7 @@ fzytest: fzytest.o match.o choices.o
17 17
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
18 18
 
19 19
 test: fzytest
20
-	-$(VALGRIND) ./fzytest
20
+	-$(DEBUGGER) ./fzytest
21 21
 
22 22
 fzy: fzy.o match.o tty.o choices.o
23 23
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
Browse code

Easy way to run tests with valgrind

VALGRIND="valgrind --leak-check=full" make test

John Hawthorn authored on 21/09/2014 21:23:01
Showing 1 changed files
... ...
@@ -5,6 +5,7 @@ CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
7 7
 BINDIR?=$(PREFIX)/bin
8
+VALGRIND?=
8 9
 
9 10
 INSTALL=install
10 11
 INSTALL_PROGRAM=$(INSTALL)
... ...
@@ -16,7 +17,7 @@ fzytest: fzytest.o match.o choices.o
16 17
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
17 18
 
18 19
 test: fzytest
19
-	-./fzytest
20
+	-$(VALGRIND) ./fzytest
20 21
 
21 22
 fzy: fzy.o match.o tty.o choices.o
22 23
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
Browse code

Version is now 0.2pre

John Hawthorn authored on 27/09/2014 23:48:38
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.1
1
+VERSION=0.2pre
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
Browse code

Version 0.1

John Hawthorn authored on 20/09/2014 21:15:28
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-VERSION=0.1beta
1
+VERSION=0.1
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
Browse code

BSD-compatible make install

John Hawthorn authored on 19/09/2014 03:06:17
Showing 1 changed files
... ...
@@ -21,12 +21,13 @@ test: fzytest
21 21
 fzy: fzy.o match.o tty.o choices.o
22 22
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
23 23
 
24
-%.o: %.c
24
+%.o: %.c config.h
25 25
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
26 26
 
27 27
 install: fzy
28 28
 	$(INSTALL_PROGRAM) fzy $(DESTDIR)$(BINDIR)/fzy
29
-	$(INSTALL_PROGRAM) -D fzy.1 $(DESTDIR)$(MANDIR)/man1/fzy.1
29
+	$(INSTALL_PROGRAM) -d $(DESTDIR)$(MANDIR)/man1
30
+	$(INSTALL_PROGRAM) fzy.1 $(DESTDIR)$(MANDIR)/man1/fzy.1
30 31
 
31 32
 clean:
32 33
 	$(RM) fzy fzytest *.o
Browse code

Move _GNU_SOURCE definition to makefile

John Hawthorn authored on 18/09/2014 03:23:20
Showing 1 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 VERSION=0.1beta
2 2
 
3
-CPPFLAGS=-DVERSION=\"${VERSION}\"
3
+CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
Browse code

Add -pedantic, Remove stray ;

John Hawthorn authored on 18/09/2014 03:22:41
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 VERSION=0.1beta
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\"
4
-CFLAGS+=-Wall -Wextra -g -std=c99 -O3
4
+CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
7 7
 BINDIR?=$(PREFIX)/bin
Browse code

Add manpage to make install

John Hawthorn authored on 15/09/2014 04:29:27
Showing 1 changed files
... ...
@@ -3,6 +3,8 @@ VERSION=0.1beta
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\"
4 4
 CFLAGS+=-Wall -Wextra -g -std=c99 -O3
5 5
 PREFIX?=/usr/local
6
+MANDIR?=$(PREFIX)/share/man
7
+BINDIR?=$(PREFIX)/bin
6 8
 
7 9
 INSTALL=install
8 10
 INSTALL_PROGRAM=$(INSTALL)
... ...
@@ -23,7 +25,8 @@ fzy: fzy.o match.o tty.o choices.o
23 25
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
24 26
 
25 27
 install: fzy
26
-	$(INSTALL_PROGRAM) fzy $(DESTDIR)$(PREFIX)/bin/fzy
28
+	$(INSTALL_PROGRAM) fzy $(DESTDIR)$(BINDIR)/fzy
29
+	$(INSTALL_PROGRAM) -D fzy.1 $(DESTDIR)$(MANDIR)/man1/fzy.1
27 30
 
28 31
 clean:
29 32
 	$(RM) fzy fzytest *.o
Browse code

Fix divide by zero on empty choices list

John Hawthorn authored on 15/09/2014 03:26:09
Showing 1 changed files
... ...
@@ -10,7 +10,7 @@ INSTALL_DATA=${INSTALL} -m 644
10 10
 
11 11
 all: fzy fzytest
12 12
 
13
-fzytest: fzytest.o match.o
13
+fzytest: fzytest.o match.o choices.o
14 14
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
15 15
 
16 16
 test: fzytest
Browse code

Cleanup headers

John Hawthorn authored on 15/09/2014 02:42:43
Showing 1 changed files
... ...
@@ -19,7 +19,7 @@ test: fzytest
19 19
 fzy: fzy.o match.o tty.o choices.o
20 20
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
21 21
 
22
-%.o: %.c fzy.h
22
+%.o: %.c
23 23
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
24 24
 
25 25
 install: fzy
Browse code

Refactor into choices.c

John Hawthorn authored on 14/09/2014 05:19:52
Showing 1 changed files
... ...
@@ -16,7 +16,7 @@ fzytest: fzytest.o match.o
16 16
 test: fzytest
17 17
 	-./fzytest
18 18
 
19
-fzy: fzy.o match.o tty.o
19
+fzy: fzy.o match.o tty.o choices.o
20 20
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
21 21
 
22 22
 %.o: %.c fzy.h
Browse code

Compile with -O3

John Hawthorn authored on 07/09/2014 00:59:12
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 VERSION=0.1beta
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\"
4
-CFLAGS+=-Wall -Wextra -g -std=c99 -O2
4
+CFLAGS+=-Wall -Wextra -g -std=c99 -O3
5 5
 PREFIX?=/usr/local
6 6
 
7 7
 INSTALL=install
... ...
@@ -11,13 +11,13 @@ INSTALL_DATA=${INSTALL} -m 644
11 11
 all: fzy fzytest
12 12
 
13 13
 fzytest: fzytest.o match.o
14
-	$(CC) $(CCFLAGS) -o $@ $^
14
+	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
15 15
 
16 16
 test: fzytest
17 17
 	-./fzytest
18 18
 
19 19
 fzy: fzy.o match.o tty.o
20
-	$(CC) $(CCFLAGS) -o $@ $^
20
+	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
21 21
 
22 22
 %.o: %.c fzy.h
23 23
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
Browse code

Fix missing bin in Makefile

Change-Id: If849f07175e5accfa26179b555e5f59e39b6826f

John Hawthorn authored on 11/08/2014 18:32:07
Showing 1 changed files
... ...
@@ -23,7 +23,7 @@ fzy: fzy.o match.o tty.o
23 23
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
24 24
 
25 25
 install: fzy
26
-	$(INSTALL_PROGRAM) fzy $(DESTDIR)$(PREFIX)/fzy
26
+	$(INSTALL_PROGRAM) fzy $(DESTDIR)$(PREFIX)/bin/fzy
27 27
 
28 28
 clean:
29 29
 	$(RM) fzy fzytest *.o
Browse code

Update README.md

John Hawthorn authored on 04/08/2014 21:47:40
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 VERSION=0.1beta
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\"
4
-CFLAGS+=-Wall -Wextra -g -std=c99
4
+CFLAGS+=-Wall -Wextra -g -std=c99 -O2
5 5
 PREFIX?=/usr/local
6 6
 
7 7
 INSTALL=install
Browse code

Split tty functions into tty.c

John Hawthorn authored on 04/08/2014 04:56:17
Showing 1 changed files
... ...
@@ -16,7 +16,7 @@ fzytest: fzytest.o match.o
16 16
 test: fzytest
17 17
 	-./fzytest
18 18
 
19
-fzy: fzy.o match.o
19
+fzy: fzy.o match.o tty.o
20 20
 	$(CC) $(CCFLAGS) -o $@ $^
21 21
 
22 22
 %.o: %.c fzy.h
Browse code

Add version string

John Hawthorn authored on 27/07/2014 04:51:27
Showing 1 changed files
... ...
@@ -1,3 +1,6 @@
1
+VERSION=0.1beta
2
+
3
+CPPFLAGS=-DVERSION=\"${VERSION}\"
1 4
 CFLAGS+=-Wall -Wextra -g -std=c99
2 5
 PREFIX?=/usr/local
3 6
 
Browse code

Add make install

John Hawthorn authored on 27/07/2014 04:38:58
Showing 1 changed files
... ...
@@ -1,4 +1,9 @@
1 1
 CFLAGS+=-Wall -Wextra -g -std=c99
2
+PREFIX?=/usr/local
3
+
4
+INSTALL=install
5
+INSTALL_PROGRAM=$(INSTALL)
6
+INSTALL_DATA=${INSTALL} -m 644
2 7
 
3 8
 all: fzy fzytest
4 9
 
... ...
@@ -14,7 +19,10 @@ fzy: fzy.o match.o
14 19
 %.o: %.c fzy.h
15 20
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
16 21
 
22
+install: fzy
23
+	$(INSTALL_PROGRAM) fzy $(DESTDIR)$(PREFIX)/fzy
24
+
17 25
 clean:
18 26
 	$(RM) fzy fzytest *.o
19 27
 
20
-.PHONY: test all clean
28
+.PHONY: test all clean install
Browse code

Replace ruby tests with some C

Ruby tests were a nice way to start, and it was nice to borrow some from
selecta. However, it's going to be much easier to write tests in the
same language as the implementation.

John Hawthorn authored on 27/07/2014 02:51:50
Showing 1 changed files
... ...
@@ -1,12 +1,12 @@
1 1
 CFLAGS+=-Wall -Wextra -g -std=c99
2 2
 
3
-all: fzy testscore
3
+all: fzy fzytest
4 4
 
5
-testscore: testscore.o match.o
5
+fzytest: fzytest.o match.o
6 6
 	$(CC) $(CCFLAGS) -o $@ $^
7 7
 
8
-test: testscore
9
-	ruby test.rb
8
+test: fzytest
9
+	-./fzytest
10 10
 
11 11
 fzy: fzy.o match.o
12 12
 	$(CC) $(CCFLAGS) -o $@ $^
... ...
@@ -15,4 +15,6 @@ fzy: fzy.o match.o
15 15
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
16 16
 
17 17
 clean:
18
-	$(RM) fzy testscore *.o
18
+	$(RM) fzy fzytest *.o
19
+
20
+.PHONY: test all clean
Browse code

Move declarations into fzy.h

John Hawthorn authored on 26/07/2014 09:37:24
Showing 1 changed files
... ...
@@ -11,5 +11,8 @@ test: testscore
11 11
 fzy: fzy.o match.o
12 12
 	$(CC) $(CCFLAGS) -o $@ $^
13 13
 
14
+%.o: %.c fzy.h
15
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
16
+
14 17
 clean:
15 18
 	$(RM) fzy testscore *.o
Browse code

New DP algorithm match scoring algorithm

John Hawthorn authored on 13/07/2014 00:45:07
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-CFLAGS+=-Wall -Wextra -g
1
+CFLAGS+=-Wall -Wextra -g -std=c99
2 2
 
3 3
 all: fzy testscore
4 4
 
Browse code

Add tests and split matching into match.c

John Hawthorn authored on 12/07/2014 22:07:22
Showing 1 changed files
... ...
@@ -1,10 +1,15 @@
1
-LIBS=
2 1
 CFLAGS+=-Wall -Wextra -g
3
-TARGET=fzy
4
-OBJECTS=fzy.o
5 2
 
6
-$(TARGET): $(OBJECTS)
7
-	$(CC) $(CCFLAGS) -o $@ $^ $(LIBS)
3
+all: fzy testscore
4
+
5
+testscore: testscore.o match.o
6
+	$(CC) $(CCFLAGS) -o $@ $^
7
+
8
+test: testscore
9
+	ruby test.rb
10
+
11
+fzy: fzy.o match.o
12
+	$(CC) $(CCFLAGS) -o $@ $^
8 13
 
9 14
 clean:
10
-	$(RM) $(TARGET) *.o
15
+	$(RM) fzy testscore *.o
Browse code

Makefile: s/CXX/CC/g

John Hawthorn authored on 12/07/2014 05:53:13
Showing 1 changed files
... ...
@@ -4,7 +4,7 @@ TARGET=fzy
4 4
 OBJECTS=fzy.o
5 5
 
6 6
 $(TARGET): $(OBJECTS)
7
-	$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
7
+	$(CC) $(CCFLAGS) -o $@ $^ $(LIBS)
8 8
 
9 9
 clean:
10 10
 	$(RM) $(TARGET) *.o
Browse code

Rename fzy

John Hawthorn authored on 12/07/2014 04:21:14
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 LIBS=
2 2
 CFLAGS+=-Wall -Wextra -g
3
-TARGET=hawthfuzz
4
-OBJECTS=hawthfuzz.o
3
+TARGET=fzy
4
+OBJECTS=fzy.o
5 5
 
6 6
 $(TARGET): $(OBJECTS)
7 7
 	$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
Browse code

something of a working version

John Hawthorn authored on 11/07/2014 09:45:17
Showing 1 changed files
... ...
@@ -1,5 +1,5 @@
1 1
 LIBS=
2
-CFLAGS+=-Wall -g
2
+CFLAGS+=-Wall -Wextra -g
3 3
 TARGET=hawthfuzz
4 4
 OBJECTS=hawthfuzz.o
5 5
 
Browse code

initial commit

John Hawthorn authored on 11/07/2014 08:36:31
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,10 @@
1
+LIBS=
2
+CFLAGS+=-Wall -g
3
+TARGET=hawthfuzz
4
+OBJECTS=hawthfuzz.o
5
+
6
+$(TARGET): $(OBJECTS)
7
+	$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
8
+
9
+clean:
10
+	$(RM) $(TARGET) *.o