1 #@ .makefile, solely for creating the C++ .main.cc test program
2 #@ With CC=tcc, AR=tcc ARFLAGS=-ar!
4 su_USECASE_MX_DISABLED =
9 CXXFLAGS+=-Wall -pedantic -Dsu_HAVE_DEVEL -Dsu_HAVE_DEBUG
10 CFLAGS+=-Wall -pedantic -Dsu_HAVE_DEVEL -Dsu_HAVE_DEBUG
12 CSRC = avopt.c core-code.c core-errors.c \
13 cs-alloc.c cs-ctype.c cs-dict.c cs-find.c cs-misc.c \
14 cs-rfind.c cs-tbox.c cs-tools.c \
15 icodec-dec.c icodec-enc.c \
16 mem-alloc.c mem-bag.c mem-tools.c \
18 CXXSRC = cxx-core.cc \
23 .SUFFIXES: .o .c .cc .y
25 $(CXX) -Dsu_USECASE_SU -I../../src -I../../include \
26 $(CXXFLAGS) -o $(@) -c $(<)
28 $(CC) -Dsu_USECASE_SU -I../../src -I../../include \
29 $(CFLAGS) -o $(@) -c $(<)
33 CXXOBJ = $(CXXSRC:.cc=.o)
34 OBJ = $(COBJ) $(CXXOBJ)
38 rm -f ../../include/su/gen-config.h .main .tmp* .clib.a $(OBJ)
40 $(COBJ): $(CSRC) ../../include/su/gen-config.h
42 $(AR) $(ARFLAGS) $(@) $(COBJ)
43 $(CXXOBJ): $(CLIB) ../../include/su/gen-config.h
44 .main: $(CXXOBJ) .clib.a
45 $(CXX) $(LDFLAGS) -o $(@) $(CXXOBJ) .clib.a
47 ../../include/su/gen-config.h:
48 SRCDIR=`dirname \`pwd\``/ TARGET="$(@)" awk="$(awk)" \
49 $(SHELL) ../../mk/su-make-errors.sh config > .tmp.c &&\
50 $(CC) -o .tmp .tmp.c &&\
53 echo '#define su_PAGE_SIZE '"`$(getconf) PAGESIZE`" >> $(@)