summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2014-11-16 11:10:23 +0900
committerFreeArtMan <dos21h@gmail.com>2014-11-16 11:10:23 +0900
commite8574a9621a2cbe50b22aa5aa8114bcebce22b38 (patch)
tree6e77d3872827926ce108f15e312d699fefbbd23a /Makefile
parentc84cc88f0b34d8802390e2a7b6dab7f07ba277d1 (diff)
downloadmicrobbs-e8574a9621a2cbe50b22aa5aa8114bcebce22b38.tar.gz
microbbs-e8574a9621a2cbe50b22aa5aa8114bcebce22b38.zip
Preparation to article list feature. Added debug.h and mmm.h
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 443b8ca..0d61766 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,23 @@
PROJECT=microbbs
CC=gcc
CFLAGS=
-SOURCES=motd.c buildinfo.c sysinfo.c articles.c logs.c vote.c
+SOURCES=motd.c buildinfo.c sysinfo.c articles.c logs.c vote.c list.c mmm.c
OBJECTS=$(SOURCES:.c=.o)
-
-all: $(OBJECTS) $(PROJECT)
+BUILD_DIR=build_dir
+
+all: mkdir $(OBJECTS) $(PROJECT)
+
+mkdir:
+ mkdir -p $(BUILD_DIR)
$(PROJECT): $(SOURCES)
cd ./libterm; make
- $(CC) $(OBJECTS) $(CFLAGS) libterm/libterm.o microbbs.c -o $(PROJECT)
+ $(CC) $(addprefix $(BUILD_DIR)/,$(OBJECTS)) $(CFLAGS) libterm/libterm.o microbbs.c -o $(PROJECT)
%.o: %.c
- $(CC) $(CFLAGS) -c $<
+ $(CC) $(CFLAGS) -c $< -o $(BUILD_DIR)/$@
clean:
rm -rf *.o microbbs
+ cd ./$(BUILD_DIR); rm -rf *.o
cd ./libterm; make clean