Révision 304
approxBasisSollya/Makefile (revision 304) | ||
---|---|---|
6 | 6 |
INCS = approxbaso.h read-lines-from-file.h |
7 | 7 |
SOURCES = $(INCS) approxbaso.c readlines-from-file.c |
8 | 8 |
|
9 |
TEST_DRIVER = # CUnit test driver binary program |
|
10 | 9 |
TEST_DIR = test |
11 |
TEST_SOURCES = $(TEST_DIR)/$(TEST_DRIVER).c \ |
|
12 |
# Add the suites definition sources |
|
13 | 10 |
|
14 | 11 |
ALL_TARGETS = $(OBJS) |
15 | 12 |
|
... | ... | |
54 | 51 |
.PRECIOUS: $(OBJS) |
55 | 52 |
|
56 | 53 |
all: $(ALL_TARGETS) |
57 |
test: $(TEST_DRIVER) |
|
58 | 54 |
|
55 |
test: |
|
56 |
@$(MAKE) -C $(TEST_DIR) test |
|
57 |
|
|
59 | 58 |
% : %.o $(OBJS) |
60 | 59 |
$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB) |
61 | 60 |
|
62 | 61 |
%.o : %.c $(INCS) |
63 | 62 |
$(CC) $(CFLAGS) -c -o $@ $< |
64 | 63 |
|
65 |
$(TEST_DRIVER) : |
|
66 |
make -C test |
|
67 |
cp test/$(TEST_DRIVER) . |
|
68 | 64 |
# ------------------------------------------------------------------------- |
69 | 65 |
|
70 | 66 |
.PHONY: clean scratch |
71 | 67 |
|
72 | 68 |
clean: |
73 |
@rm -f $(ALL_TARGETS) $(TEST_DRIVER)
|
|
69 |
@rm -f $(ALL_TARGETS) |
|
74 | 70 |
@rm -f *.o a.out $(OBJS) |
75 | 71 |
@rm -f *~ *% #*# |
76 | 72 |
@make -C $(TEST_DIR) clean |
... | ... | |
79 | 75 |
rm -f $(SCRATCH_ALL) |
80 | 76 |
|
81 | 77 |
# Change the documentation configuration and path accordingly. |
82 |
documentation: pobyso.doxyconf $(SOURCES)
|
|
78 |
documentation: approxbaso.doxyconf $(SOURCES)
|
|
83 | 79 |
doxygen approxbaso.doxyconf |
approxBasisSollya/test/Makefile (revision 304) | ||
---|---|---|
1 |
CC = gcc |
|
2 |
CFLAGS = -Wall -g |
|
3 |
LDLIB = #-Wl,--verbose |
|
1 |
# The Makefile only switches to lower level test Makefiles. |
|
4 | 2 |
|
5 |
OBJS = |
|
6 |
INCS = |
|
7 |
SOURCES = $(INCS) |
|
3 |
default: test |
|
8 | 4 |
|
9 |
TEST_DRIVER = # CUnit test driver binary program |
|
10 |
|
|
11 |
ALL_TARGETS = |
|
12 |
|
|
13 |
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c)) |
|
14 |
SCRATCH_ALL := $(SCRATCH_PRG) |
|
15 |
|
|
16 |
LAST_ARCH_FILE = lastArch.txt |
|
17 |
|
|
18 |
ARCH := $(shell uname -m) |
|
19 |
|
|
20 |
DUMMY := $(shell touch $(LAST_ARCH_FILE)) |
|
21 |
|
|
22 |
LAST_ARCH := $(shell cat $(LAST_ARCH_FILE)) |
|
23 |
|
|
24 |
ifneq ($(LAST_ARCH), $(ARCH)) |
|
25 |
DUMMY := $(shell echo $(ARCH) > $(LAST_ARCH_FILE)) |
|
26 |
DUMMY := $(shell $(MAKE) clean) |
|
27 |
endif |
|
28 |
|
|
29 |
ifeq (x86_64, $(ARCH)) |
|
30 |
CFLAGS := -m64 $(CFLAGS) |
|
31 |
# LDLIB := |
|
32 |
endif |
|
33 |
|
|
34 |
ifeq (ppc64, $(ARCH)) |
|
35 |
CFLAGS := -m64 $(CFLAGS) |
|
36 |
# LDLIB := |
|
37 |
endif |
|
38 |
|
|
39 |
ifeq (i686, $(ARCH)) |
|
40 |
# CFLAGS := $(CFLAGS) |
|
41 |
# LDLIB := |
|
42 |
endif |
|
43 |
|
|
44 |
# ------------------------------------------------------------------------- |
|
45 |
|
|
46 |
default: all |
|
47 |
# Remove all implicit (suffix) rules. No need to remove pattern rules. |
|
48 |
# Just redefine them. |
|
49 |
.SUFFIXES: |
|
50 |
# Keep the OBJS we want to link with user code. |
|
51 |
.PRECIOUS: $(OBJS) |
|
52 |
|
|
53 |
all: $(ALL_TARGETS) |
|
54 |
test: $(TEST_DRIVER) |
|
55 |
|
|
56 |
% : %.o $(OBJS) |
|
57 |
$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB) |
|
58 |
|
|
59 |
%.o : %.c $(INCS) |
|
60 |
$(CC) $(CFLAGS) -c -o $@ $< |
|
61 |
|
|
62 |
$(TEST_DRIVER) : |
|
63 |
make -C test |
|
64 |
cp test/$(TEST_DRIVER) . |
|
65 |
# ------------------------------------------------------------------------- |
|
66 |
|
|
67 |
.PHONY: clean scratch |
|
68 |
|
|
69 |
clean: |
|
70 |
@rm -f $(ALL_TARGETS) $(TEST_DRIVER) |
|
71 |
@rm -f *.o a.out $(OBJS) |
|
72 |
@rm -f *~ *% #*# |
|
73 |
|
|
74 |
|
|
5 |
test: |
|
6 |
@$(MAKE) -C test-approxbaso test |
|
7 |
@$(MAKE) -C test-read-lines test |
approxBasisSollya/read-lines-from-file.c (revision 304) | ||
---|---|---|
80 | 80 |
{ |
81 | 81 |
#ifndef NDEBUG |
82 | 82 |
fprintf(stderr, |
83 |
"\n%s: requested line inted (%d) is beyhond\n",
|
|
83 |
"\n%s: requested line (%d) is beyond\n",
|
|
84 | 84 |
__func__, |
85 | 85 |
lineIndex); |
86 | 86 |
fprintf(stderr, |
... | ... | |
89 | 89 |
#endif |
90 | 90 |
return NULL; |
91 | 91 |
} |
92 |
return linesRead->lines + lineIndex * linesRead->linesLenght;
|
|
92 |
return linesRead->lines + lineIndex * linesRead->linesLength;
|
|
93 | 93 |
} /* End rlff_get_line_at. */ |
94 | 94 |
|
95 | 95 |
/** @see read-lines-from-file.h#rlff_print_lines */ |
... | ... | |
189 | 189 |
} |
190 | 190 |
|
191 | 191 |
linesRead->linesNum = rlffLinesCount; |
192 |
linesRead->linesLenght = rlffLinesLength;
|
|
192 |
linesRead->linesLength = rlffLinesLength;
|
|
193 | 193 |
if ((rlffLinesCount == 0) || (rlffLinesLength == 0)) |
194 | 194 |
{ |
195 | 195 |
/* The file is somehow empty: not an actual error. */ |
196 | 196 |
linesRead->linesNum = 0; |
197 |
linesRead->linesLenght = 0;
|
|
197 |
linesRead->linesLength = 0;
|
|
198 | 198 |
linesRead->lines = NULL; |
199 | 199 |
return linesRead; |
200 | 200 |
} |
... | ... | |
279 | 279 |
break; |
280 | 280 |
} |
281 | 281 |
} /* End while. */ |
282 |
bufferCurrentLinePtr += linesRead->linesLenght;
|
|
282 |
bufferCurrentLinePtr += linesRead->linesLength;
|
|
283 | 283 |
bufferCurrentCharPtr = bufferCurrentLinePtr; |
284 | 284 |
} /* End c == '\n'. */ |
285 | 285 |
} /* End main while; ancillary*/ |
approxBasisSollya/read-lines-from-file.h (revision 304) | ||
---|---|---|
21 | 21 |
struct rlff_readLines |
22 | 22 |
{ |
23 | 23 |
unsigned int linesNum; |
24 |
unsigned int linesLenght;
|
|
24 |
unsigned int linesLength;
|
|
25 | 25 |
char* lines; |
26 | 26 |
}; |
27 | 27 |
|
Formats disponibles : Unified diff