mirror of
https://github.com/krislamo/knrc.git
synced 2024-11-10 00:30:35 +00:00
Simplify Makefile to compile all C sources
This commit is contained in:
parent
d8a70f8b58
commit
c24a724efb
30
Makefile
30
Makefile
@ -1,28 +1,10 @@
|
|||||||
all: hello mathvars c2f input count countlines blanks unambiguous
|
CC = gcc
|
||||||
|
OBJS = $(patsubst %.c,bin/%,$(wildcard *.c))
|
||||||
|
|
||||||
hello: 01-hello-world.c
|
all: $(OBJS)
|
||||||
gcc -o ./bin/01-helloworld 01-hello-world.c
|
|
||||||
|
|
||||||
mathvars: 02-vars-and-math.c
|
$(OBJS):
|
||||||
gcc -o ./bin/02-mathvars 02-vars-and-math.c
|
$(CC) -o ./$@ $(patsubst bin/%,%.c,$@)
|
||||||
|
|
||||||
c2f: 03-celsius-to-fahrenheit.c
|
|
||||||
gcc -o ./bin/03-c2f 03-celsius-to-fahrenheit.c
|
|
||||||
|
|
||||||
input: 04-file-copying.c
|
|
||||||
gcc -o ./bin/04-input 04-file-copying.c
|
|
||||||
|
|
||||||
count: 05-char-counting.c
|
|
||||||
gcc -o ./bin/05-count 05-char-counting.c
|
|
||||||
|
|
||||||
countlines: 06-line-count.c
|
|
||||||
gcc -o ./bin/06-line-count 06-line-count.c
|
|
||||||
|
|
||||||
blanks: 07-extra-blanks.c
|
|
||||||
gcc -o ./bin/07-extra-blanks 07-extra-blanks.c
|
|
||||||
|
|
||||||
unambiguous: 08-unambiguous.c
|
|
||||||
gcc -o ./bin/08-unambiguous 08-unambiguous.c
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) ./bin/*-*
|
$(RM) ./bin/*
|
||||||
|
Loading…
Reference in New Issue
Block a user