aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 8917d8e..a21748b 100644
--- a/Makefile
+++ b/Makefile
@@ -12,16 +12,22 @@ BUILD_DIR:=build
test: CFLAGS := -std=c99 -O0 -g -Wall -DDEBUG
test: $(BUILD_DIR) tests/parcini
-tests/%: $(OBJ_DIR)/src/tests/%.o $(OBJ_DIR)/src/%.o $(PARCINI_OBJECTS)
+tests/%: $(OBJ_DIR)/src/tests/%.o $(PARCINI_OBJECTS)
$(CC) $(LDFLAGS) -o $(BUILD_DIR)/$@ $^
$(BUILD_DIR)/$@
+example: CFLAGS := -std=c99 -O2 -Wall
+example: $(OBJ_DIR)/example/example.o $(PARCINI_OBJECTS)
+ $(CC) $(LDFLAGS) -o $(BUILD_DIR)/example/$@ $^
+
$(OBJ_DIR)/%.o: %.c
$(CC) -c $(CFLAGS) $(INC_DIRS) -o $@ $<
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)/tests
+ mkdir -p $(BUILD_DIR)/example
mkdir -p $(OBJ_DIR)/src/tests
+ mkdir -p $(OBJ_DIR)/example
clean:
$(RM) $(OBJ_DIR)