Subject | Hash | Author | Date (UTC) |
---|---|---|---|
[feat] Edit Makefile, Add config.def.h, config.mk | c9e13a7b6dcc00894620f5788c04f4afba0f59d4 | Hassan Afify | 2019-09-21 17:11:34 |
[fix] Replace CODE_STYLE with CONTRIBUTING.md | be2b91ef8d73aea536bc45446808633561d8afd9 | Hassan Afify | 2019-09-21 11:14:30 |
[feat] Edit Makefile, azan.c | 538877a4311572caa1ddb88ffd0bac5e0b4379bc | Hassan Afify | 2019-09-20 12:59:05 |
[feat] Edit Makefile | f41f74a524feb96228eb35a77a336862d5ca958c | Hassan Afify | 2019-09-19 05:04:00 |
[feat] Self Calcutation | 1be712f454adda33c8a182a4478a3abf5dba6745 | Hassan Afify | 2019-09-17 08:11:15 |
[init] Initial Commit | 2654768d0412e07cf7aa4b78a41b125aeceab82e | Hassan Afify | 2019-09-04 01:44:23 |
File | Lines added | Lines deleted |
---|---|---|
Makefile | 38 | 19 |
config.def.h | 0 | 0 |
config.mk | 22 | 0 |
File Makefile changed (mode: 100644) (index f1a0021..431b21e) | |||
1 | 1 | # azan | # azan |
2 | 2 | # See LICENSE file for copyright and license details. | # See LICENSE file for copyright and license details. |
3 | 3 | ||
4 | include config.mk | ||
5 | |||
4 | 6 | SRC = azan.c | SRC = azan.c |
5 | 7 | OBJ = ${SRC:.c=.o} | OBJ = ${SRC:.c=.o} |
6 | TARGET = azan | ||
7 | CC = tcc | ||
8 | STD = -std=c99 | ||
9 | WARN = -bench -Wall -Werror -Wunusupported -Wwrite-strings | ||
10 | CFLAGS = ${STD} ${WARN} | ||
11 | LIBS = -lm | ||
12 | 8 | ||
13 | all: $(OBJ) | ||
14 | $(CC) $(CFLAGS) $(OBJ) $(LIBS) -g -o $(TARGET) | ||
9 | all: options azan | ||
10 | |||
11 | options: | ||
12 | @echo azan build options: | ||
13 | @echo "CFLAGS = $(STCFLAGS)" | ||
14 | @echo "LDFLAGS = $(STLDFLAGS)" | ||
15 | @echo "CC = $(CC)" | ||
16 | |||
17 | config.h: | ||
18 | cp config.def.h config.h | ||
19 | |||
20 | .c.o: | ||
21 | $(CC) $(STCFLAGS) -g -c $< | ||
15 | 22 | ||
16 | %.o: %.c | ||
17 | $(CC) $(CFLAGS) -c $^ | ||
23 | azan.o: config.h azan.h | ||
18 | 24 | ||
19 | install: $(TARGET) | ||
20 | cp -f $^ /usr/local/bin | ||
21 | chmod 755 /usr/local/bin/$^ | ||
22 | # sed "s/VERSION/${VERSION}/g" < azan.1 > ${DESTDIR}${MANPREFIX}/man1/azan.1 | ||
25 | $(OBJ): config.h config.mk | ||
26 | |||
27 | azan: $(OBJ) | ||
28 | $(CC) -o $@ $(OBJ) $(STLDFLAGS) | ||
23 | 29 | ||
24 | 30 | clean: | clean: |
25 | rm -f $(OBJ) $(TARGET) | ||
31 | rm -f $(OBJ) azan | ||
32 | |||
33 | install: azan | ||
34 | mkdir -p $(DESTDIR)$(PREFIX)/bin | ||
35 | cp -f $^ $(DESTDIR)$(PREFIX)/bin | ||
36 | chmod 755 $(DESTDIR)$(PREFIX)/bin/$^ | ||
37 | mkdir -p $(DESTDIR)$(MANPREFIX)/man1 | ||
38 | sed "s/VERSION/$(VERSION)/g" < $^.1 > $(DESTDIR)$(MANPREFIX)/man1/$^.1 | ||
39 | chmod 644 $(DESTDIR)$(MANPREFIX)/man1/$^.1 | ||
26 | 40 | ||
27 | 41 | uninstall: | uninstall: |
28 | rm -f /bin/$(TARGET) | ||
42 | rm -f $(DESTDIR)$(PREFIX)/bin/azan | ||
43 | rm -f $(DESTDIR)$(MANPREFIX)/man1/azan.1 | ||
44 | |||
45 | check: valgrind splint | ||
46 | |||
47 | valgrind: azan | ||
48 | valgrind --track-origins=yes -v --read-var-info=yes --leak-check=full --log-file=valgrind.log ./azan | ||
29 | 49 | ||
30 | check: $(SRC) $(TARGET) | ||
31 | valgrind --track-origins=yes -v --read-var-info=yes --leak-check=full --log-file=valgrind.log ./$(TARGET) | ||
50 | splint: azan.c | ||
32 | 51 | splint $(SRC) > splint.log | splint $(SRC) > splint.log |
33 | 52 | ||
34 | .PHONY: all clean install uninstall check | ||
53 | .PHONY: all clean install uninstall check splint valgrind |
File config.def.h copied from file config.h (similarity 100%) |
File config.mk added (mode: 100644) (index 0000000..37dfaea) | |||
1 | # azan version | ||
2 | VERSION = 0.0.2 | ||
3 | |||
4 | # Customize below to fit your system | ||
5 | |||
6 | # paths | ||
7 | PREFIX = /usr/local | ||
8 | MANPREFIX = $(PREFIX)/share/man | ||
9 | |||
10 | PKG_CONFIG = pkg-config | ||
11 | |||
12 | #includes and libs | ||
13 | STD = -std=c99 | ||
14 | WARN = -bench -Wall -Werror -Wunusupported -Wwrite-strings | ||
15 | LIBS = -lm | ||
16 | |||
17 | # flags | ||
18 | STCFLAGS = $(STD) $(WARN) | ||
19 | STLDFLAGS= $(LIBS) $(LDFLAGS) | ||
20 | |||
21 | # compiler and linker | ||
22 | CC = tcc |