# +----------------------------------------------------------------------+ # | Aubit 4gl Language Compiler Version $.0 lib makefile | # +----------------------------------------------------------------------+ # | Copyright (c) 2000-1 Aubit Development Team (See Credits file) | # +----------------------------------------------------------------------+ # | This program is free software; you can redistribute it and/or modify | # | it under the terms of one of the following licenses: | # | | # | A) the GNU General Public License as published by the Free Software | # | Foundation; either version 2 of the License, or (at your option) | # | any later version. | # | | # | B) the Aubit License as published by the Aubit Development Team and | # | included in the distribution in the file: LICENSE | # | | # | This program is distributed in the hope that it will be useful, | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # | GNU General Public License for more details. | # | | # | You should have received a copy of both licenses referred to here. | # | If you did not, or have any questions about Aubit licensing, please | # | contact afalout@ihug.co.nz | # +----------------------------------------------------------------------+ # # $Id: Makefile.in,v 1.14 2006/07/27 16:03:16 mikeaubury Exp $ # ROOT =../../.. #All stuff common to more then one Aubit compiler make file is there: include ${ROOT}/incl/Makefile-common ## ================================================================== ## Source files ## ================================================================== CMODS =menuwrite.c loadmenu.c OBJS =${CMODS:.c=.o} CFLAGS +=-I.. -I../../libui -I${LIBROOT}/libui/ui_gtk #we cannot compile GTK code with -Wstrict-prototypes because #GTK+ supplied libraries have many functions declared without parameters CFLAGS_GTK_C =$(CFLAGS:%-Wstrict-prototypes=%) ## ================================================================== ## Options ## ================================================================== GLIB_CFLAGS =@GLIB_CFLAGS@ GTK_INC_PATH =@GTK_INC_PATH@ GTK_LIB_PATH =@GTK_LIB_PATH@ GTKLIBS =@GTKLIBS@ HOSTNAME :=$(shell echo $$HOSTNAME) ifeq "${WIN_PATH}" "1" #ifeq "" "$(findstring cygdrive,${GTK_INC_PATH})" ifeq "" "$(findstring :,${GTK_INC_PATH})" #under cygwin path /usr/lib/ is actailly a symling to /lib, but "real" Windows #app (like MingGW) don't know anythign about links! So for now we will add path to #there. -ID:/cygwin/usr/lib/glib-2.0/include ADD_ME=-I${WIN_CYGPATH}/lib/glib-2.0/include -I${WIN_CYGPATH}/lib/gtk-2.0/include GLIB_CFLAGS :=$(subst -I,-I${WIN_CYGPATH},${GLIB_CFLAGS}) ${ADD_ME} GTK_INC_PATH:=$(subst -I,-I${WIN_CYGPATH},${GTK_INC_PATH}) ${ADD_ME} GTK_LIB_PATH:=$(subst -L,-L${WIN_CYGPATH},${GTK_LIB_PATH}) -L${WIN_CYGPATH}/lib endif endif GTKLIBS :=$(subst -rdynamic,,${GTKLIBS}) #Need to find better sollution for this: #dropline.net and other installers have -lintl, but zip has -lintl-1 #ifeq "${HOSTNAME}" "istation" # GTKLIBS :=$(subst -lintl,-lintl-1,${GTKLIBS}) #endif CFLAGS +=-I.. -I. -I${ROOT}/incl -I${ROOT}/common/dataio ${GLIB_CFLAGS} \ ${GTK_INC_PATH} ${GTK_LIB_PATH} #CFLAGS :=-I${ROOT}/compilers/menus ${CFLAGS} -I${ROOT}/compilers/menus -I${ROOT}/common/dataio CFLAGS :=$(subst /target/build,/usr,${CFLAGS}) GTK_LIB_PATH :=$(subst /target/build,/usr,${GTK_LIB_PATH}) CFLAGS :=$(subst /target,/usr,${CFLAGS}) GTK_LIB_PATH :=$(subst /target,/usr,${GTK_LIB_PATH}) ifeq "${WIN_PATH}" "1" #ifeq "" "$(findstring cygdrive,${GTK_LIB_PATH})" ifeq "" "$(findstring :,${GTK_LIB_PATH})" GTK_LIB_PATH :=$(subst -L,-L${WIN_CYGPATH},${GTK_LIB_PATH}) -L${WIN_CYGPATH}/lib endif endif ALL +=${PLUGINDIR}/libMENU_GENERIC${SO_EXT} #we don't want -Wall in CFLAGS when compiling form_x_xdr.c because it would #give us bunch of warnings about unised varibles, that we cannot fix #because this file is generated by rpcgen: CFLAGS_FORM_X_XDR_C =$(CFLAGS:%-Wall=%) # We don't want -Wmissing-declarations and -Wmissing-prototypes when # compiling C code created by 4glc, since it is not creating prototypes, # so we get lots of warnings: CFLAGS_4GLC2 =$(CFLAGS:%-Wmissing-declarations=%) CFLAGS_4GLC1 =$(CFLAGS_4GLC2:%-Wmissing-prototypes=%) CFLAGS_4GLC =$(CFLAGS_4GLC1:%-Wstrict-prototypes=%) #we cannot compile GTK code with -Wstrict-prototypes because #GTK+ supplied libraries have many functions declared without parameters CFLAGS_GTK_C =$(CFLAGS:%-Wstrict-prototypes=%) #Fails with error: initializer element is not computable at load time: ifeq "${NON_PEDANTIC_OK}" "1" CFLAGS_4GLC :=$(CFLAGS_4GLC:%-pedantic=%) endif ifneq "${COMSPEC}" "" LINKLIBS =-L${LIBROOT} -l${AUBITLIBFULL} endif ## ================================================================== ## Targets ## ================================================================== all: ${ALL} @echo "Default targets (${ALL}) built successfully." ${PLUGINDIR}/libMENU_GENERIC${SO_EXT} : ${OBJS} ${LD} ${SO_LDFLAGS} -o $@ $^ ${GTK_LIB_PATH} ${LINKLIBS} ${GTKLIBS} ## ================================================================== ## Sub Targets ## ================================================================== ci: $(CMODS) ci -l $^ #${ROOT}/compilers/menus/menu_x_xdr.c ${ROOT}/compilers/menus/menu_x.h: # ${MAKE} -C ${ROOT}/compilers/menus rpc #${ROOT}/compilers/menus/menu_x_xdr.o: ${ROOT}/compilers/menus/menu_x_xdr.c # ${CC} ${CFLAGS_MENU_X_XDR_C} -c -o $@ $^ #loadmenu.o: loadmenu.c # ${CC} ${CFLAGS_GTK_C} -c -o $@ $^ #cannot use strict prototiping when includign GTK headers: %.o: %.c ${CC} ${CFLAGS_GTK_C} -c -o $@ $^ show: @echo "GLIB_CFLAGS=${GLIB_CFLAGS}" @echo "GTK_INC_PATH=${GTK_INC_PATH}" @echo "GTK_LIB_PATH=${GTK_LIB_PATH}" @echo "GTKLIBS=${GTKLIBS}" @echo "HOSTNAME=${HOSTNAME}" @echo "HOSTNAME= $$HOSTNAME" ## ================================================================== ## Dependencies ## ================================================================== #${ROOT}/compilers/menus/menu_x_xdr.o: ${ROOT}/compilers/menus/menu_x.h #error.c : generated/tmperrs.h #array.o: array.c ${ROOT}/compilers/fcompile/form_x_xdr.c #builtin.c: ${ROOT}/compilers/fcompile/form_x.h ## ================================================================== ## Clean Targets ## ================================================================== clean : ${RM} $(OBJS) $(OBJS_DEBUG) menu_x.h menu_x_xdr.c core \ *.out *.glb ${PLUGINDIR}/libMENU_GENERIC${SO_EXT} *.a *.o *.bak *.exe *.stackdump *.err \ *.base *.exp *.def ## ================================================================== ## Other Targets ## ================================================================== lclint: $(CMODS) -lclint -weak $(CFLAGS) $(CMODS) > lclint.log 2>&1 @echo "see lclint.log for results" #----------------------------------- EOF -------------------------------