diff --git a/CMakeLists.txt b/CMakeLists.txt index b7a22ab..fbc3ffe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -project (ifchd) +project (ndhcp) cmake_minimum_required (VERSION 2.6) @@ -8,18 +8,5 @@ set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -s -std=gnu99 -pedantic -Wall -lcap -DHAVE #include_directories("${PROJECT_SOURCE_DIR}/ncmlib") #add_subdirectory(ncmlib) -set(IFCHD_SRCS - ifchd.c - linux.c - strlist.c - signals.c - pidfile.c - chroot.c - nstrl.c - log.c - ) - -add_executable(ifchd ${IFCHD_SRCS}) -#target_link_libraries(ifchd ncmlib) - +add_subdirectory(ifchd) add_subdirectory(ndhc) diff --git a/Makefile b/Makefile deleted file mode 100644 index 354eb23..0000000 --- a/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -CC = gcc -Wall -Wpointer-arith -Wstrict-prototypes -AR = ar -objects = log.o nstrl.o chroot.o pidfile.o signals.o strlist.o linux.o ifchd.o - -ifchd : $(objects) - $(CC) -lcap -o ifchd $(objects) - -ifchd.o : log.h nstrl.h chroot.h pidfile.h signals.h strlist.h linux.h - $(CC) $(CFLAGS) $(archflags) $(LDFLAGS) -c -o $@ ifchd.c - -linux.o: log.h strlist.h -chroot.o: log.h -pidfile.o: log.h -signals.o: log.h -strlist.o: -nstrl.o: -log.o : - -install: ifchd - -install -s -m 755 ifchd /usr/sbin/ifchd -tags: - -ctags -f tags *.[ch] - -cscope -b -clean: - -rm -f *.o ifchd -distclean: - -rm -f *.o ifchd tags cscope.out - diff --git a/ifchd/CMakeLists.txt b/ifchd/CMakeLists.txt new file mode 100644 index 0000000..5283926 --- /dev/null +++ b/ifchd/CMakeLists.txt @@ -0,0 +1,17 @@ +project (ifchd) + +cmake_minimum_required (VERSION 2.6) + +set(IFCHD_SRCS + ifchd.c + linux.c + strlist.c + signals.c + pidfile.c + chroot.c + nstrl.c + log.c + ) + +add_executable(ifchd ${IFCHD_SRCS}) +#target_link_libraries(ifchd ncmlib) diff --git a/ChangeLog b/ifchd/ChangeLog similarity index 100% rename from ChangeLog rename to ifchd/ChangeLog diff --git a/DESIGN b/ifchd/DESIGN similarity index 100% rename from DESIGN rename to ifchd/DESIGN diff --git a/LICENSE b/ifchd/LICENSE similarity index 100% rename from LICENSE rename to ifchd/LICENSE diff --git a/README.ifchd b/ifchd/README.ifchd similarity index 100% rename from README.ifchd rename to ifchd/README.ifchd diff --git a/TODO b/ifchd/TODO similarity index 100% rename from TODO rename to ifchd/TODO diff --git a/chroot.c b/ifchd/chroot.c similarity index 100% rename from chroot.c rename to ifchd/chroot.c diff --git a/chroot.h b/ifchd/chroot.h similarity index 100% rename from chroot.h rename to ifchd/chroot.h diff --git a/defines.h b/ifchd/defines.h similarity index 100% rename from defines.h rename to ifchd/defines.h diff --git a/ifchd.c b/ifchd/ifchd.c similarity index 100% rename from ifchd.c rename to ifchd/ifchd.c diff --git a/ifproto.h b/ifchd/ifproto.h similarity index 100% rename from ifproto.h rename to ifchd/ifproto.h diff --git a/linux.c b/ifchd/linux.c similarity index 100% rename from linux.c rename to ifchd/linux.c diff --git a/linux.h b/ifchd/linux.h similarity index 100% rename from linux.h rename to ifchd/linux.h diff --git a/log.c b/ifchd/log.c similarity index 100% rename from log.c rename to ifchd/log.c diff --git a/log.h b/ifchd/log.h similarity index 100% rename from log.h rename to ifchd/log.h diff --git a/nstrl.c b/ifchd/nstrl.c similarity index 100% rename from nstrl.c rename to ifchd/nstrl.c diff --git a/nstrl.h b/ifchd/nstrl.h similarity index 100% rename from nstrl.h rename to ifchd/nstrl.h diff --git a/pidfile.c b/ifchd/pidfile.c similarity index 100% rename from pidfile.c rename to ifchd/pidfile.c diff --git a/pidfile.h b/ifchd/pidfile.h similarity index 100% rename from pidfile.h rename to ifchd/pidfile.h diff --git a/signals.c b/ifchd/signals.c similarity index 100% rename from signals.c rename to ifchd/signals.c diff --git a/signals.h b/ifchd/signals.h similarity index 100% rename from signals.h rename to ifchd/signals.h diff --git a/strlist.c b/ifchd/strlist.c similarity index 100% rename from strlist.c rename to ifchd/strlist.c diff --git a/strlist.h b/ifchd/strlist.h similarity index 100% rename from strlist.h rename to ifchd/strlist.h diff --git a/ndhc/CMakeLists.txt b/ndhc/CMakeLists.txt index 7a633f1..f8dc3c8 100644 --- a/ndhc/CMakeLists.txt +++ b/ndhc/CMakeLists.txt @@ -2,9 +2,6 @@ project (ndhc) cmake_minimum_required (VERSION 2.6) -#include_directories("${PROJECT_SOURCE_DIR}/ncmlib") -#add_subdirectory(ncmlib) - set(NDHC_SRCS nstrl.c log.c diff --git a/ndhc/Makefile b/ndhc/Makefile deleted file mode 100644 index 31620e9..0000000 --- a/ndhc/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# ndhc makefile - -prefix=/usr -SBINDIR=/sbin -USRSBINDIR=${prefix}/sbin -USRBINDIR=${prefix}/bin -USRSHAREDIR=${prefix}/share - -# Uncomment this for extra output and to compile with debugging symbols -#DEBUG=1 - -#CROSS_COMPILE=arm-uclibc- -CC = $(CROSS_COMPILE)gcc -LD = $(CROSS_COMPILE)gcc -INSTALL = install - -VER := 0.9.8 - - -OBJS_SHARED = nstrl.o log.o options.o socket.o packet.o rootcap.o -DHCPC_OBJS = dhcpc.o clientpacket.o script.o - -EXEC2 = ndhc -OBJS2 = -lcap $(DHCPC_OBJS) $(OBJS_SHARED) - -BOOT_PROGRAMS = ndhc - -ifdef SYSLOG -CFLAGS += -DSYSLOG -endif - -CFLAGS += -W -Wall -Wstrict-prototypes -DVERSION='"$(VER)"' - -ifdef DEBUG -CFLAGS += -g -DDEBUG -STRIP=true -else -CFLAGS += -Os -fomit-frame-pointer -STRIP=$(CROSS_COMPILE)strip -endif - -all: $(EXEC2) - $(STRIP) --remove-section=.note --remove-section=.comment $(EXEC2) - -$(OBJS2) $(OBJS3): *.h Makefile -$(EXEC2): Makefile - -.c.o: - $(CC) -c $(CFLAGS) $< - -$(EXEC2): $(OBJS2) - $(LD) $(LDFLAGS) $(OBJS2) -o $(EXEC2) - -tags: - -ctags -f tags *.[ch] - -cscope -b - -install: all - - $(INSTALL) $(BOOT_PROGRAMS) $(USRSBINDIR) - mkdir -p $(USRSHAREDIR)/man/man8 - $(INSTALL) ndhc.8 ndhc.8 $(USRSHAREDIR)/man/man8 - -clean: - -rm -f ndhc *.o core - -distclean: - -rm -f ndhc *.o tags cscope.out -