mirror of
https://gitee.com/Lamdonn/varch.git
synced 2025-12-06 08:46:42 +08:00
106 lines
3.9 KiB
Makefile
106 lines
3.9 KiB
Makefile
##################################################################################
|
|
### config
|
|
##################################################################################
|
|
CC = gcc
|
|
BUILT_DIR = built
|
|
TARGET = app
|
|
|
|
##################################################################################
|
|
### source locations
|
|
##################################################################################
|
|
WORKSPACE = source
|
|
TESTSPACE = test
|
|
APPLICATION_PATH = $(WORKSPACE)/00_application
|
|
GENDATA_PATH = $(WORKSPACE)/01_general
|
|
VSTD_PATH = $(WORKSPACE)/02_vstd
|
|
CONTAINER_PATH = $(WORKSPACE)/03_container
|
|
ALGORITHM_PATH = $(WORKSPACE)/04_algorithm
|
|
PARSER_PATH = $(WORKSPACE)/05_parser
|
|
|
|
##################################################################################
|
|
### sources and head path
|
|
##################################################################################
|
|
INCLUDE += -I $(APPLICATION_PATH)
|
|
INCLUDE += -I $(GENDATA_PATH)
|
|
INCLUDE += -I $(VSTD_PATH)
|
|
INCLUDE += -I $(CONTAINER_PATH)
|
|
INCLUDE += -I $(ALGORITHM_PATH)
|
|
INCLUDE += -I $(PARSER_PATH)
|
|
|
|
SOURCES += $(APPLICATION_PATH)/init.c
|
|
SOURCES += $(APPLICATION_PATH)/main.c
|
|
SOURCES += $(wildcard $(APPLICATION_PATH)/console/*.c)
|
|
SOURCES += $(wildcard $(GENDATA_PATH)/*.c)
|
|
SOURCES += $(wildcard $(VSTD_PATH)/*.c)
|
|
SOURCES += $(wildcard $(CONTAINER_PATH)/*.c)
|
|
SOURCES += $(wildcard $(ALGORITHM_PATH)/*.c)
|
|
SOURCES += $(wildcard $(PARSER_PATH)/*.c)
|
|
|
|
#----------------------------------------
|
|
# test sources
|
|
#----------------------------------------
|
|
# SOURCES += $(TESTSPACE)/test_init.c
|
|
# SOURCES += $(TESTSPACE)/test_kern.c
|
|
# SOURCES += $(TESTSPACE)/test_valloc.c
|
|
SOURCES += $(TESTSPACE)/test_arg.c
|
|
# SOURCES += $(TESTSPACE)/test_vstd.c
|
|
# SOURCES += $(TESTSPACE)/test_vlog.c
|
|
# SOURCES += $(TESTSPACE)/test_ini.c
|
|
# SOURCES += $(TESTSPACE)/test_txls.c
|
|
# SOURCES += $(TESTSPACE)/test_xml.c
|
|
# SOURCES += $(TESTSPACE)/test_csv.c
|
|
# SOURCES += $(TESTSPACE)/test_json.c
|
|
# SOURCES += $(TESTSPACE)/test_vector.c
|
|
# SOURCES += $(TESTSPACE)/test_list.c
|
|
# SOURCES += $(TESTSPACE)/test_str.c
|
|
# SOURCES += $(TESTSPACE)/test_queue.c
|
|
# SOURCES += $(TESTSPACE)/test_stack.c
|
|
# SOURCES += $(TESTSPACE)/test_deque.c
|
|
# SOURCES += $(TESTSPACE)/test_set.c
|
|
# SOURCES += $(TESTSPACE)/test_dict.c
|
|
# SOURCES += $(TESTSPACE)/test_map.c
|
|
# SOURCES += $(TESTSPACE)/test_heap.c
|
|
# SOURCES += $(TESTSPACE)/test_tree.c
|
|
# SOURCES += $(TESTSPACE)/test_rbtree.c
|
|
# SOURCES += $(TESTSPACE)/test_pthread.c
|
|
# SOURCES += $(TESTSPACE)/test_encrypt.c
|
|
# SOURCES += $(TESTSPACE)/test_calculate.c
|
|
# SOURCES += $(TESTSPACE)/test_command.c
|
|
# SOURCES += $(TESTSPACE)/test_check.c
|
|
# SOURCES += $(TESTSPACE)/test_crc.c
|
|
# SOURCES += $(TESTSPACE)/test_sort.c
|
|
# SOURCES += $(TESTSPACE)/test_hash.c
|
|
# SOURCES += $(TESTSPACE)/test_pid.c
|
|
# SOURCES += $(TESTSPACE)/test_search.c
|
|
# SOURCES += $(TESTSPACE)/test_filter.c
|
|
# SOURCES += $(TESTSPACE)/test_oscp.c
|
|
# SOURCES += $(TESTSPACE)/test_tool.c
|
|
# SOURCES += $(TESTSPACE)/test_sList.c
|
|
# SOURCES += $(TESTSPACE)/test_dList.c
|
|
# SOURCES += $(TESTSPACE)/test_cQueue.c
|
|
|
|
##################################################################################
|
|
### targets and recipes
|
|
##################################################################################
|
|
OBJS = $(patsubst %.c, $(BUILT_DIR)/%.o, $(SOURCES))
|
|
TAR_PATH = $(BUILT_DIR)/$(TARGET)
|
|
|
|
# link
|
|
${TAR_PATH}:$(OBJS)
|
|
# @ $(CC) $(OBJS) -o $(TAR_PATH) -lm -lX11 -lpthread
|
|
@ $(CC) $(OBJS) -o $(TAR_PATH) -lm -lpthread
|
|
|
|
# compile
|
|
$(BUILT_DIR)/%.o:%.c
|
|
$(shell mkdir -p $(dir $@))
|
|
@ echo "compiling $(notdir $<)"
|
|
@ $(CC) $(INCLUDE) -c $< -o $@
|
|
|
|
.PHONY:clean
|
|
clean:
|
|
@echo "remove app and objs files ..."
|
|
$(shell rm $(BUILT_DIR)/$(WORKSPACE) -rf)
|
|
$(shell rm $(BUILT_DIR)/* -rf)
|
|
|
|
|