Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion usr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
SUBDIRS = lib sbin
EXPLIB_SUBDIRS = lib

.include <${RULES_MK}>
#.include <${RULES_MK}>
all:
for i in $(SUBDIRS); do \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUBDIR should also have "lib/methods" directory to compile cfg_ipf utility.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add for "sbin/64" as well if required.

(cd $$i && $(MAKE) $(MAKEFLAGS)); \
done
12 changes: 9 additions & 3 deletions usr/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ LIBRARIES = libipf.a
EXPLIB_TARGETS = export_libipf.a
EXPDIR = /usr/lib/ipfilter/

INCFLAGS = -I${MAKETOP}/ipfl/kernext -I${MAKETOP}/ipfl/kernext/netinet
CFLAGS = -D_AIX -D_AIX51 -DAIX -qlanglvl=ansi
MAKETOP=../..
INCFLAGS = -I${MAKETOP}/kernext -I${MAKETOP}/kernext/netinet
CFLAGS = -D_AIX -D_AIX51 -DAIX -D_NOGETDELIM -qlanglvl=ansi ${INCFLAGS}

OFILES = addicmp.o addipopt.o bcopywrap.o \
binprint.o buildopts.o checkrev.o count6bits.o count4bits.o \
Expand All @@ -45,4 +46,9 @@ OFILES = addicmp.o addipopt.o bcopywrap.o \
to_interface.o var.o verbose.o v6ionames.o v6optvalue.o
OFILES64 = ${OFILES:.o=.64o}

.include <${RULES_MK}>
#.include <${RULES_MK}>

all: $(LIBRARIES)

$(LIBRARIES): $(OFILES)
$(AR) $(ARFLAGS) $@ $(OFILES)
75 changes: 54 additions & 21 deletions usr/sbin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,85 +23,118 @@ ILIST = ${PROGRAMS} IPFL.README
IPFL.README_IDIR = /usr/lpp/ipfl/
IDIR = /usr/sbin/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes will not invoke Makefile presents in "./64" directory.
Current makefile can create 64 bit binary for all utilities,but then we will not have binary with <binary_name> and <binary_name>64 ,based on the architecture(i.e. 32 bit and 64 bit).

INCFLAGS = -I${MAKETOP}/ipfl/kernext -I${MAKETOP}/ipfl/kernext/netinet
LIBFLAGS = -L${EXPORTBASE}/usr/lib/ipfilter
VPATH = .:${MAKETOP}/ipfl/usr/lib
MAKETOP = ../..
INCFLAGS = -I${MAKETOP}/kernext -I${MAKETOP}/kernext/netinet
LIBFLAGS = -L${MAKETOP}/usr/lib
VPATH = ${MAKETOP}/usr/lib

LIBS = -lipf
CFLAGS = -D_AIX -D_AIX51 -DAIX
CFLAGS = -D_AIX -D_AIX51 -DAIX -D_NOGETDELIM $(INCFLAGS)
LDFLAGS = $(LIBFLAGS)

ipf_OFILES = ipf.o ipfcomp.o ipf_y.o ipf_l.o
ipfs_OFILES = ipfs.o
ipfstat_OFILES = ipfstat.o
ipmon_OFILES = ipmon.o ipmon_y.o ipmon_l.o
ipnat_OFILES = ipnat.o ipnat_y.o ipnat_l.o
ippool_OFILES = ippool_y.o ippool_l.o kmem.o ippool.o
ippool_OFILES = ippool_y.o ippool_l.o ${MAKETOP}/usr/lib/kmem.o ippool.o
ipscan_OFILES = ipscan_y.o ipscan_l.o
ipsyncm_OFILES = ipsyncm.o
ipsyncs_OFILES = ipsyncs.o

.include <${RULES_MK}>
RM = /usr/bin/rm
SED = /usr/bin/sed

#.include <${RULES_MK}>

all: $(PROGRAMS)

clean:
$(RM) -f $(PROGRAMS) *.o *_[ly].c

ipf: $(ipf_OFILES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ipf_OFILES) $(LIBS)

ipmon: $(ipmon_OFILES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ipmon_OFILES) $(LIBS)

ipnat: $(ipnat_OFILES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ipnat_OFILES) $(LIBS)

ippool: $(ippool_OFILES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ippool_OFILES) $(LIBS)

ipscan: $(ipscan_OFILES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ipscan_OFILES) $(LIBS)

ipfstat: $(ipfstat_OFILES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ipfstat_OFILES) $(LIBS)

ipf_y.h: ipf_y.c
ipf_y.c: ipf_l.h
${YACC} -d $<
${YACC} ${YFLAGS} -d $<
${SED} -e 's/yy/ipf_yy/g' -e 's/y.tab.c/ipf_y.c/' \
y.tab.c > $@
${SED} -e 's/yy/ipf_yy/g' -e 's/y.tab.h/ipf_y.h/' \
y.tab.h > ipf_y.h
${RM} -f y.tab.c y.tab.h
ipf_l.c: lexer.c ipf_y.h
${SED} -e 's/yy/ipf_yy/g' -e 's/y.tab.h/ipf_y.h/' \
-e 's/lexer.h/ipf_l.h/' ${lexer.c:P} > $@
-e 's/lexer.h/ipf_l.h/' lexer.c > $@
ipf_l.h: lexer.h
${SED} -e 's/yy/ipf_yy/g' ${lexer.h:P} > $@
${SED} -e 's/yy/ipf_yy/g' lexer.h > $@

ipmon_y.h: ipmon_y.c
ipmon_y.c: ipmon_l.h
${YACC} -d $<
${YACC} ${YFLAGS} -d $<
${SED} -e 's/yy/ipmon_yy/g' y.tab.c > $@
${SED} -e 's/yy/ipmon_yy/g' y.tab.h > ipmon_y.h
${RM} -f y.tab.c y.tab.h
ipmon_l.c: lexer.c ipmon_y.h
${SED} -e 's/yy/ipmon_yy/g' -e 's/y.tab.h/ipmon_y.h/' \
-e 's/lexer.h/ipmon_l.h/' ${lexer.c:P} > $@
-e 's/lexer.h/ipmon_l.h/' lexer.c > $@
ipmon_l.h: lexer.h
${SED} -e 's/yy/ipmon_yy/g' ${lexer.h:P} > $@
${SED} -e 's/yy/ipmon_yy/g' lexer.h > $@

ipnat_y.h: ipnat_y.c
ipnat_y.c: ipnat_l.h
${YACC} -d $<
${YACC} ${YFLAGS} -d $<
${SED} -e 's/yy/ipnat_yy/g' -e 's/y.tab.c/ipnat_y.c/' \
y.tab.c > $@
${SED} -e 's/yy/ipnat_yy/g' -e 's/y.tab.h/ipnat_y.h/' \
y.tab.h > ipnat_y.h
${RM} -f y.tab.c y.tab.h
ipnat_l.c: lexer.c ipnat_y.h
${SED} -e 's/yy/ipnat_yy/g' -e 's/y.tab.h/ipnat_y.h/' \
-e 's/lexer.h/ipnat_l.h/' ${lexer.c:P} > $@
-e 's/lexer.h/ipnat_l.h/' lexer.c > $@
ipnat_l.h: lexer.h
${SED} -e 's/yy/ipnat_yy/g' ${lexer.h:P} > $@
${SED} -e 's/yy/ipnat_yy/g' lexer.h > $@

ippool_y.h: ippool_y.c
ippool_y.c: ippool_l.h
${YACC} -d $<
${YACC} ${YFLAGS} -d $<
${SED} -e 's/yy/ippool_yy/g' y.tab.c > $@
${SED} -e 's/yy/ippool_yy/g' y.tab.h > ippool_y.h
${RM} -f y.tab.c y.tab.h
ippool_l.c: lexer.c ippool_y.h
${SED} -e 's/yy/ippool_yy/g' -e 's/y.tab.h/ippool_y.h/' \
-e 's/lexer.h/ippool_l.h/' ${lexer.c:P} > $@
-e 's/lexer.h/ippool_l.h/' lexer.c > $@
ippool_l.h: lexer.h
${SED} -e 's/yy/ippool_yy/g' ${lexer.h:P} > $@
${SED} -e 's/yy/ippool_yy/g' lexer.h > $@

ipscan_y.h: ipscan_y.c
ipscan_y.c: ipscan_l.h
${YACC} -d $<
${YACC} ${YFLAGS} -d $<
${SED} -e 's/yy/ipscan_yy/g' y.tab.c > $@
${SED} -e 's/yy/ipscan_yy/g' y.tab.h > ipscan_y.h
${RM} -f y.tab.c y.tab.h
ipscan_l.c: lexer.c ipscan_y.h
${SED} -e 's/yy/ipscan_yy/g' -e 's/y.tab.h/ipscan_y.h/' \
-e 's/lexer.h/ipscan_l.h/' ${lexer.c:P} > $@
-e 's/lexer.h/ipscan_l.h/' lexer.c > $@
ipscan_l.h: lexer.h
${SED} -e 's/yy/ipscan_yy/g' ${lexer.h:P} > $@
${SED} -e 's/yy/ipscan_yy/g' lexer.h > $@

${MAKETOP}/usr/lib/kmem.o: ${MAKETOP}/usr/lib/kmem.c
cd ${MAKETOP}/usr/lib && make kmem.o