Build binaries in bin/

This commit is contained in:
@@@No user configured@@@ 2016-05-16 01:53:40 +02:00
parent e217d1b9fd
commit 9b76c4f9f7
2 changed files with 3 additions and 2 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
bin/*

View file

@ -2,7 +2,7 @@
SRC = $(wildcard src/*.c) SRC = $(wildcard src/*.c)
DEPS = $(wildcard deps/**/*.c) DEPS = $(wildcard deps/**/*.c)
OBJS = $(patsubst %.c,%.o,$(DEPS)) 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 = -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__
CFLAGS = -ggdb -std=c99 -Ideps -Wall -Wno-unused-function -pedantic CFLAGS = -ggdb -std=c99 -Ideps -Wall -Wno-unused-function -pedantic
@ -12,7 +12,7 @@ all: $(BINS)
echo "BINS=$(BINS)" echo "BINS=$(BINS)"
$(BINS): $(SRC) $(OBJS) $(BINS): $(SRC) $(OBJS)
$(CC) $(CFLAGS) -o $@ src/$@.c $(OBJS) $(LDFLAGS) $(CC) $(CFLAGS) -o $@ src/$(notdir $@).c $(OBJS) $(LDFLAGS)
%.o: %.c %.o: %.c
$(CC) $< -c -o $@ $(CFLAGS) $(CC) $< -c -o $@ $(CFLAGS)