File tree 4 files changed +24
-7
lines changed
4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 1
1
ff-sort
2
2
* .png
3
3
* .jpg
4
+ result
Original file line number Diff line number Diff line change 3
3
CC ?= cc
4
4
CFLAGS ?= -Os
5
5
CPPFLAGS += -pedantic -Wall -Wextra
6
- FARBHERD =1
6
+ FARBHERD =0
7
7
8
- DESTDIR ?= /usr/local
8
+ PREFIX ?= /usr/local
9
+ DESTDIR ?= /
9
10
10
11
# but not this..
11
12
CPPFLAGS += -DFARBHERD=$(FARBHERD )
@@ -14,10 +15,11 @@ BINS=ff-sort
14
15
all : $(BINS )
15
16
16
17
ff-sort : ff-sort.c
17
- $(CC ) $(CPPFLAGS ) $(CFLAGS ) $(LDFLAGS ) -o $@ $^
18
+ $(CC ) $(CPPFLAGS ) $(CFLAGS ) $(LDFLAGS ) -o $@ $^ -lm
18
19
19
20
install : $(BINS )
20
- install $(BINS ) $(DESTDIR ) /bin
21
+ install -d $(DESTDIR ) /$(PREFIX ) /bin
22
+ install $(BINS ) $(DESTDIR ) /$(PREFIX ) /bin
21
23
22
24
clean :
23
25
rm -f $(BINS )
Original file line number Diff line number Diff line change
1
+ with import <nixpkgs> { } ;
2
+ stdenv . mkDerivation {
3
+ src = ./. ;
4
+ name = "ff-sort" ;
5
+ enableParallelBuilding = true ;
6
+
7
+ installPhase = ''
8
+ make install PREFIX=$out
9
+ '' ;
10
+ }
Original file line number Diff line number Diff line change 33
33
}
34
34
35
35
static void usage (char * self , int status ) {
36
- eprintf ("Usage: <farbfeld source> | %s [-x|-y] [-t type] [-l min] [-u max] [type] [args..] | <farbfeld sink>\n" , self );
36
+ eprintf (
37
+ "Usage: <farbfeld source> | %s [-x|-y] [-l min] [-u max] type [args..] | <farbfeld sink>\n"
38
+ "Type is one of:\n"
39
+ "\tred/green/blue - color channel\n"
40
+ "\tsum - sum of the above\n"
41
+ "\thue/saturation/value - HSV\n" , self );
37
42
exit (status );
38
43
}
39
44
@@ -89,7 +94,6 @@ static int options;
89
94
#define SEL_X 0
90
95
#define SEL_Y 1
91
96
92
- static int detection = 0 ;
93
97
#define SEL_BRUTE 0
94
98
#define SEL_EDGES 1 // soon.
95
99
@@ -300,7 +304,7 @@ int main(int argc, char* argv[]) {
300
304
301
305
// parse arguments
302
306
int opt ;
303
- while ((opt = getopt (argc , argv , "xyrhu:l:t: " )) != -1 ) {
307
+ while ((opt = getopt (argc , argv , "xyrhu:l:" )) != -1 ) {
304
308
switch (opt ) {
305
309
case 'x' :
306
310
options = SEL_X ;
You can’t perform that action at this time.
0 commit comments