make/solaris/makefiles/adlc.make
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
hs-6771309 Cdiff make/solaris/makefiles/adlc.make
make/solaris/makefiles/adlc.make
Print this page
rev 461 : Fixed 6771309: debugging AD files is difficult without #line directives in generated code
Summary: more and better #line and #define directives in the generated code; ADLC itself accepts #line directives
Reviewed-by: never, kvn
*** 52,65 ****
# set INCLUDES for C preprocessor
Src_Dirs_I = ${Src_Dirs} $(GENERATED)
INCLUDES += $(Src_Dirs_I:%=-I%)
! # Force assertions on.
! SYSDEFS += -DASSERT
CPPFLAGS = $(SYSDEFS) $(INCLUDES)
ifndef USE_GCC
# We need libCstd.so for adlc
CFLAGS += -library=Cstd -g
LFLAGS += -library=Cstd -g
endif
--- 52,67 ----
# set INCLUDES for C preprocessor
Src_Dirs_I = ${Src_Dirs} $(GENERATED)
INCLUDES += $(Src_Dirs_I:%=-I%)
! # set flags for adlc compilation
CPPFLAGS = $(SYSDEFS) $(INCLUDES)
+ # Force assertions on.
+ CPPFLAGS += -DASSERT
+
ifndef USE_GCC
# We need libCstd.so for adlc
CFLAGS += -library=Cstd -g
LFLAGS += -library=Cstd -g
endif
*** 139,149 ****
# Get a unique temporary directory name, so multiple makes can run in parallel.
# Note that product files are updated via "mv", which is atomic.
TEMPDIR := $(OUTDIR)/mktmp$(shell echo $$$$)
! ADLCFLAGS = -q -T
ifdef LP64
ADLCFLAGS += -D_LP64
else
ADLCFLAGS += -U_LP64
--- 141,159 ----
# Get a unique temporary directory name, so multiple makes can run in parallel.
# Note that product files are updated via "mv", which is atomic.
TEMPDIR := $(OUTDIR)/mktmp$(shell echo $$$$)
! # Pass -D flags into ADLC.
! ADLCFLAGS += $(SYSDEFS)
!
! # Note "+="; it is a hook so flags.make can add more flags, like -g or -DFOO.
! ADLCFLAGS += -q -T
!
! # Normally, debugging is done directly on the ad_<arch>*.cpp files.
! # But -g will put #line directives in those files pointing back to <arch>.ad.
! #ADLCFLAGS += -g
ifdef LP64
ADLCFLAGS += -D_LP64
else
ADLCFLAGS += -U_LP64
*** 154,175 ****
# used to selectively update generated adlc files. This should
# provide a nice compilation speed improvement.
#
ADLC_UPDATER_DIRECTORY = $(GAMMADIR)/make/$(OS)
ADLC_UPDATER = adlc_updater
# This action refreshes all generated adlc files simultaneously.
# The way it works is this:
# 1) create a scratch directory to work in.
# 2) if the current working directory does not have $(ADLC_UPDATER), copy it.
# 3) run the compiled adlc executable. This will create new adlc files in the scratch directory.
# 4) call $(ADLC_UPDATER) on each generated adlc file. It will selectively update changed or missing files.
# 5) If we actually updated any files, echo a notice.
#
! refresh_adfiles: $(EXEC) $(SOURCE.AD)
@rm -rf $(TEMPDIR); mkdir $(TEMPDIR)
- $(QUIETLY) [ -f $(ADLC_UPDATER) ] || ( cp $(ADLC_UPDATER_DIRECTORY)/$(ADLC_UPDATER) . ; chmod +x $(ADLC_UPDATER) )
$(QUIETLY) $(EXEC) $(ADLCFLAGS) $(SOURCE.AD) \
-c$(TEMPDIR)/ad_$(Platform_arch_model).cpp -h$(TEMPDIR)/ad_$(Platform_arch_model).hpp -a$(TEMPDIR)/dfa_$(Platform_arch_model).cpp -v$(TEMPDIR)/adGlobals_$(Platform_arch_model).hpp \
|| { rm -rf $(TEMPDIR); exit 1; }
$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
--- 164,186 ----
# used to selectively update generated adlc files. This should
# provide a nice compilation speed improvement.
#
ADLC_UPDATER_DIRECTORY = $(GAMMADIR)/make/$(OS)
ADLC_UPDATER = adlc_updater
+ $(ADLC_UPDATER): $(ADLC_UPDATER_DIRECTORY)/$(ADLC_UPDATER)
+ $(QUIETLY) cp $< $@; chmod +x $@
# This action refreshes all generated adlc files simultaneously.
# The way it works is this:
# 1) create a scratch directory to work in.
# 2) if the current working directory does not have $(ADLC_UPDATER), copy it.
# 3) run the compiled adlc executable. This will create new adlc files in the scratch directory.
# 4) call $(ADLC_UPDATER) on each generated adlc file. It will selectively update changed or missing files.
# 5) If we actually updated any files, echo a notice.
#
! refresh_adfiles: $(EXEC) $(SOURCE.AD) $(ADLC_UPDATER)
@rm -rf $(TEMPDIR); mkdir $(TEMPDIR)
$(QUIETLY) $(EXEC) $(ADLCFLAGS) $(SOURCE.AD) \
-c$(TEMPDIR)/ad_$(Platform_arch_model).cpp -h$(TEMPDIR)/ad_$(Platform_arch_model).hpp -a$(TEMPDIR)/dfa_$(Platform_arch_model).cpp -v$(TEMPDIR)/adGlobals_$(Platform_arch_model).hpp \
|| { rm -rf $(TEMPDIR); exit 1; }
$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
*** 188,198 ****
# #########################################################################
$(SOURCE.AD): $(SOURCES.AD)
! $(QUIETLY) cat $(SOURCES.AD) > $(SOURCE.AD)
$(OUTDIR)/%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
--- 199,217 ----
# #########################################################################
$(SOURCE.AD): $(SOURCES.AD)
! $(QUIETLY) $(PROCESS_AD_FILES) $(SOURCES.AD) > $(SOURCE.AD)
!
! #PROCESS_AD_FILES = cat
! # Pass through #line directives, in case user enables -g option above:
! PROCESS_AD_FILES = awk '{ \
! if (CUR_FN != FILENAME) { CUR_FN=FILENAME; NR_BASE=NR-1; need_lineno=1 } \
! if (need_lineno && $$0 !~ /\/\//) \
! { print "\n\n\#line " (NR-NR_BASE) " \"" FILENAME "\""; need_lineno=0 }; \
! print }'
$(OUTDIR)/%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
make/solaris/makefiles/adlc.make
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File