Build binaries in bin/
This commit is contained in:
parent
e217d1b9fd
commit
9b76c4f9f7
2 changed files with 3 additions and 2 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bin/*
|
4
Makefile
4
Makefile
|
@ -2,7 +2,7 @@
|
|||
SRC = $(wildcard src/*.c)
|
||||
DEPS = $(wildcard deps/**/*.c)
|
||||
OBJS = $(patsubst %.c,%.o,$(DEPS))
|
||||
BINS = $(notdir $(patsubst %.c,%,$(SRC)))
|
||||
BINS = $(patsubst src/%,bin/%,$(patsubst %.c,%,$(SRC)))
|
||||
|
||||
# CFLAGS = -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__
|
||||
CFLAGS = -ggdb -std=c99 -Ideps -Wall -Wno-unused-function -pedantic
|
||||
|
@ -12,7 +12,7 @@ all: $(BINS)
|
|||
echo "BINS=$(BINS)"
|
||||
|
||||
$(BINS): $(SRC) $(OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ src/$@.c $(OBJS) $(LDFLAGS)
|
||||
$(CC) $(CFLAGS) -o $@ src/$(notdir $@).c $(OBJS) $(LDFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $< -c -o $@ $(CFLAGS)
|
||||
|
|
Loading…
Reference in a new issue