@@ -1,6 +1,6 @@
-OBJDIR=objs
+OBJDIR=objs/include_e
# ipfw and uipfw are built in subdirs
-INCDIRS = -I ./$(OBJDIR)/include_e -DEMULATE_SYSCTL
+INCDIRS = -I ./$(OBJDIR) -DEMULATE_SYSCTL
INCDIRS += -I ./sys -I ./extra/sys -I ./extra/sys/contrib/pf -I../../include
# ODP specific start
INCDIRS += -I$(top_srcdir)/test \
@@ -9,22 +9,33 @@ INCDIRS += -I$(top_srcdir)/test \
-I$(top_srcdir)/helper/include
# ODP specific end
+# directories ./objs ./objs/include_e ./objs/include_e/sys are already
+# created by example/ipfw/ipfw/Makefile.am
+EDIR = $(OBJDIR)/machine $(OBJDIR)/netinet $(OBJDIR)/net $(OBJDIR)/linux
+EDIR += $(OBJDIR)/altq $(OBJDIR)/netpfil/pf $(OBJDIR)/netinet6 $(OBJDIR)/vm
-OBJPATH = ./$(OBJDIR)
-
-# EFILES* are the dummy files created to avoid compilation errors.
-# Please refer Makefile.kipfw available at
-# https://github.com/luigirizzo/netmap-ipfw.git
-
-#EFILES_. = libutil.h
-#EFILES_sys = condvar.h priv.h _lock.h cpuset.h
-#EFILES_sys += lock.h ucred.h # taskqueue.h
-#EFILES_sys += sockio.h
-#EFILES_sys += cpuset.h
-#EFILES_machine = in_cksum.h
-#EFILES_netinet = in_pcb.h ip_carp.h pim.h sctp.h tcp_var.h
-#EFILES_net = if_types.h bpf.h netisr.h vnet.h
-#EFILES_linux = module.h
+# entries to create empty files
+EFILES = opt_inet.h opt_ipsec.h opt_ipdivert.h opt_inet6.h opt_ipfw.h
+EFILES += opt_mpath.h opt_mbuf_stress_test.h opt_param.h
+EFILES += sys/condvar.h sys/priv.h sys/_lock.h sys/cpuset.h sys/lock.h
+EFILES += sys/ucred.h sys/proc.h sys/sockopt.h sys/sysctl.h sys/mutex.h
+EFILES += sys/_mutex.h sys/_rwlock.h sys/rwlock.h sys/eventhandler.h
+EFILES += sys/jail.h sys/ktr.h sys/rmlock.h sys/counter.h
+EFILES += machine/in_cksum.h
+EFILES += netinet/in_pcb.h netinet/ip_carp.h netinet/pim.h netinet/sctp.h
+EFILES += netinet/tcp_var.h netinet/in_var.h netinet/ip_var.h
+EFILES += netinet/udp_var.h
+EFILES += net/if_types.h net/bpf.h net/netisr.h net/vnet.h
+EFILES += net/if_var.h net/route.h net/if_clone.h
+EFILES += linux/module.h
+EFILES += altq/if_altq.h
+EFILES += netpfil/pf/pf_mtag.h
+EFILES += netinet6/ip6_var.h
+EFILES += vm/vm.h vm/vm_extern.h
+
+include_e$(EXEEXT):
+ for i in $(EDIR); do mkdir -p $$i; done
+ for i in $(EFILES); do touch $(OBJDIR)/$$i; done
E_CFLAGS = $(INCDIRS)
E_CFLAGS += -include ./extra/glue.h # headers
@@ -77,33 +88,12 @@ IPFW_SRCS += extra/ipfw2_mod.c # bsd_compat.c
IPFW_SRCS += extra/missing.c extra/session.c
-# entries to create empty files
-#EFILES_. += opt_inet.h opt_ipsec.h opt_ipdivert.h
-#EFILES_. += opt_inet6.h opt_ipfw.h opt_mpath.h
-#EFILES_. += opt_mbuf_stress_test.h opt_param.h
-#EFILES_. += timeconv.h
-
-#EFILES_altq += if_altq.h
-
-#EFILES_net += if_var.h route.h if_clone.h
-#EFILES_netpfil/pf += pf_mtag.h
-#EFILES_netinet += in_var.h ip_var.h udp_var.h
-#EFILES_netinet6 += ip6_var.h
-#EFILES_sys += proc.h sockopt.h sysctl.h
-# new
-#EFILES_sys += mutex.h _mutex.h _rwlock.h rwlock.h
-#EFILES_sys += eventhandler.h
-#EFILES_sys += jail.h ktr.h rmlock.h
-#EFILES_sys += counter.h
-
-#EFILES_vm += vm.h vm_extern.h
-
AM_CFLAGS = $(E_CFLAGS)
AM_CFLAGS += -I$(top_srcdir)/platform/$(with_platform)/arch/$(ARCH)
AM_LDFLAGS += ../../lib/.libs/libodp.a ../../lib/.libs/libodphelper.a -lpthread
-bin_PROGRAMS = odp_uipfw$(EXEEXT)
+bin_PROGRAMS = include_e$(EXEEXT) odp_uipfw$(EXEEXT)
odp_uipfw_LDFLAGS = $(AM_LDFLAGS) -static
odp_uipfw_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example