diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ca012f..d53b863 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -project (ndhcp) +project (ndhc) cmake_minimum_required (VERSION 2.6) @@ -44,4 +44,4 @@ endif() include_directories("${PROJECT_SOURCE_DIR}/ncmlib") add_subdirectory(ncmlib) -add_subdirectory(ndhc) +add_subdirectory(src) diff --git a/Makefile b/Makefile index 4d179b3..2d19c6e 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,11 @@ # at './build/ndhc'. NCM_SRCS = $(sort $(wildcard ncmlib/*.c)) -NDHC_SRCS = $(sort $(wildcard ndhc/*.c)) +NDHC_SRCS = $(sort $(wildcard src/*.c)) NCM_OBJS = $(NCM_SRCS:.c=.o) NDHC_OBJS = $(NDHC_SRCS:.c=.o) NCM_INC = -I./ncmlib -NDHC_INC = -I./ndhc +NDHC_INC = -I./src BUILD_DIR = build OBJ_DIR = $(BUILD_DIR)/objs @@ -22,11 +22,11 @@ clean: rm -Rf $(BUILD_DIR) makedir: - mkdir -p $(BUILD_DIR) $(OBJ_DIR)/ndhc $(OBJ_DIR)/ncmlib + mkdir -p $(BUILD_DIR) $(OBJ_DIR)/src $(OBJ_DIR)/ncmlib ifchd-parse.o: - ragel -G2 -o $(BUILD_DIR)/ifchd-parse.c ndhc/ifchd-parse.rl - $(CC) $(CFLAGS) $(NCM_INC) $(NDHC_INC) -c -o $(OBJ_DIR)/ndhc/$@ $(BUILD_DIR)/ifchd-parse.c + ragel -G2 -o $(BUILD_DIR)/ifchd-parse.c src/ifchd-parse.rl + $(CC) $(CFLAGS) $(NCM_INC) $(NDHC_INC) -c -o $(OBJ_DIR)/src/$@ $(BUILD_DIR)/ifchd-parse.c %.o: %.c $(CC) $(CFLAGS) $(NCM_INC) -c -o $(OBJ_DIR)/$@ $< @@ -36,7 +36,7 @@ ncmlib.a: $(NCM_OBJS) $(RANLIB) $(BUILD_DIR)/$@ ndhc: $(NDHC_OBJS) ifchd-parse.o - $(CC) $(CFLAGS) $(NCM_INC) -o $(BUILD_DIR)/$@ $(subst ndhc/,$(OBJ_DIR)/ndhc/,$(NDHC_OBJS)) $(BUILD_DIR)/ncmlib.a $(BUILD_DIR)/objs/ndhc/ifchd-parse.o -lcap -lrt + $(CC) $(CFLAGS) $(NCM_INC) -o $(BUILD_DIR)/$@ $(subst src/,$(OBJ_DIR)/src/,$(NDHC_OBJS)) $(BUILD_DIR)/ncmlib.a $(BUILD_DIR)/objs/src/ifchd-parse.o -lcap -lrt .PHONY: all clean diff --git a/ndhc/CMakeLists.txt b/src/CMakeLists.txt similarity index 100% rename from ndhc/CMakeLists.txt rename to src/CMakeLists.txt diff --git a/ndhc/arp.c b/src/arp.c similarity index 100% rename from ndhc/arp.c rename to src/arp.c diff --git a/ndhc/arp.h b/src/arp.h similarity index 100% rename from ndhc/arp.h rename to src/arp.h diff --git a/ndhc/dhcp.c b/src/dhcp.c similarity index 100% rename from ndhc/dhcp.c rename to src/dhcp.c diff --git a/ndhc/dhcp.h b/src/dhcp.h similarity index 100% rename from ndhc/dhcp.h rename to src/dhcp.h diff --git a/ndhc/duiaid.c b/src/duiaid.c similarity index 100% rename from ndhc/duiaid.c rename to src/duiaid.c diff --git a/ndhc/duiaid.h b/src/duiaid.h similarity index 100% rename from ndhc/duiaid.h rename to src/duiaid.h diff --git a/ndhc/ifchange.c b/src/ifchange.c similarity index 100% rename from ndhc/ifchange.c rename to src/ifchange.c diff --git a/ndhc/ifchange.h b/src/ifchange.h similarity index 100% rename from ndhc/ifchange.h rename to src/ifchange.h diff --git a/ndhc/ifchd-parse.h b/src/ifchd-parse.h similarity index 100% rename from ndhc/ifchd-parse.h rename to src/ifchd-parse.h diff --git a/ndhc/ifchd-parse.rl b/src/ifchd-parse.rl similarity index 100% rename from ndhc/ifchd-parse.rl rename to src/ifchd-parse.rl diff --git a/ndhc/ifchd.c b/src/ifchd.c similarity index 100% rename from ndhc/ifchd.c rename to src/ifchd.c diff --git a/ndhc/ifchd.h b/src/ifchd.h similarity index 100% rename from ndhc/ifchd.h rename to src/ifchd.h diff --git a/ndhc/ifset.c b/src/ifset.c similarity index 100% rename from ndhc/ifset.c rename to src/ifset.c diff --git a/ndhc/ifset.h b/src/ifset.h similarity index 100% rename from ndhc/ifset.h rename to src/ifset.h diff --git a/ndhc/leasefile.c b/src/leasefile.c similarity index 100% rename from ndhc/leasefile.c rename to src/leasefile.c diff --git a/ndhc/leasefile.h b/src/leasefile.h similarity index 100% rename from ndhc/leasefile.h rename to src/leasefile.h diff --git a/ndhc/ndhc-defines.h b/src/ndhc-defines.h similarity index 100% rename from ndhc/ndhc-defines.h rename to src/ndhc-defines.h diff --git a/ndhc/ndhc.8 b/src/ndhc.8 similarity index 100% rename from ndhc/ndhc.8 rename to src/ndhc.8 diff --git a/ndhc/ndhc.c b/src/ndhc.c similarity index 100% rename from ndhc/ndhc.c rename to src/ndhc.c diff --git a/ndhc/ndhc.h b/src/ndhc.h similarity index 100% rename from ndhc/ndhc.h rename to src/ndhc.h diff --git a/ndhc/netlink.c b/src/netlink.c similarity index 100% rename from ndhc/netlink.c rename to src/netlink.c diff --git a/ndhc/netlink.h b/src/netlink.h similarity index 100% rename from ndhc/netlink.h rename to src/netlink.h diff --git a/ndhc/nl.c b/src/nl.c similarity index 100% rename from ndhc/nl.c rename to src/nl.c diff --git a/ndhc/nl.h b/src/nl.h similarity index 100% rename from ndhc/nl.h rename to src/nl.h diff --git a/ndhc/options.c b/src/options.c similarity index 100% rename from ndhc/options.c rename to src/options.c diff --git a/ndhc/options.h b/src/options.h similarity index 100% rename from ndhc/options.h rename to src/options.h diff --git a/ndhc/seccomp.c b/src/seccomp.c similarity index 100% rename from ndhc/seccomp.c rename to src/seccomp.c diff --git a/ndhc/seccomp.h b/src/seccomp.h similarity index 100% rename from ndhc/seccomp.h rename to src/seccomp.h diff --git a/ndhc/sockd.c b/src/sockd.c similarity index 100% rename from ndhc/sockd.c rename to src/sockd.c diff --git a/ndhc/sockd.h b/src/sockd.h similarity index 100% rename from ndhc/sockd.h rename to src/sockd.h diff --git a/ndhc/state.c b/src/state.c similarity index 100% rename from ndhc/state.c rename to src/state.c diff --git a/ndhc/state.h b/src/state.h similarity index 100% rename from ndhc/state.h rename to src/state.h diff --git a/ndhc/sys.c b/src/sys.c similarity index 100% rename from ndhc/sys.c rename to src/sys.c diff --git a/ndhc/sys.h b/src/sys.h similarity index 100% rename from ndhc/sys.h rename to src/sys.h