delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/01/23:17:20

From: Rik Blok <blok AT physics DOT ubc DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: building Windows equivalent of RHIDE
Date: Sun, 01 Feb 1998 20:02:13 -0800
Organization: Lynx Internet
Lines: 181
Message-ID: <34D54545.832C7A3B@physics.ubc.ca>
NNTP-Posting-Host: lynx-152.lynx.bc.ca
Mime-Version: 1.0
CC: Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

This is a multi-part message in MIME format.
--------------DEA78C44A988999FBFFBC4BD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've been posting some dumb questions to c.o.m.d lately but hopefully
this will clear up my motives.

I've been trying to figure out how to turn my plain-old Windows95 text
editor into a programming IDE like Borland C++ or RHIDE.  Although I've
run into difficulties I'm still pretty sure it can be done.

It isn't working yet but attached is ide.mk the makefile which runs the
whole thing.  Basically, I want something where each user's favorite
editor acts as the front end for DJGPP via make.  All the editor should
require is the ability to run custom commands and pass filenames to
these commands.  

Here's an example of how I have my command menu set up in my editor
(note %n expands to the current filename root):

	Menu Item	Command Line
	---------	------------
	Make		make %n.exe MAKEFILES=/c/ide.mk
	Run		make %n.exe run EXE=%n.exe MAKEFILES=/c/ide.mk
	Debug		make debug EXE=%n.exe MAKEFILES=/c/ide.mk
	Profile		make profile EXE=%n.exe MAKEFILES=/c/ide.mk
	Commandline	make cmdln MAKEFILES=/c/ide.mk
	Toggle Debug	make toggleDebug MAKEFILES=/c/ide.mk
	Toggle Profile	make toggleProfile MAKEFILES=/c/ide.mk
	Show Toggles	make showToggles MAKEFILES=/c/ide.mk

This isn't working yet but you get the idea of what I'm going for.

I would appreciate all your expertise on getting this project up and
running (especially, you Robert Hoehne!).  I think there are many people
out there who would like to see this happen.

-Rik

Other issues:
1) My editor can use context-sensitive help so converting the texinfo
files to .hlp format would be useful.  
2) The user should be able to specify an external debugger.  Personally,
I plan on using RHGDB.
3) The editor should have an option to capture output so that error
messages and stuff are brought up in the editor.
4) Although I'm not using it myself I'm kind of gearing all this towards
the editor PFE because it is freeware.  I think it supports everything
mentioned here.

-- 
Rik Blok  <blok AT physics DOT ubc DOT ca>
Department of Physics and Astronomy,
University of British Columbia, Canada
http://www.physics.ubc.ca/~blok/
--------------DEA78C44A988999FBFFBC4BD
Content-Type: text/plain; charset=us-ascii; name="ide.mk"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="ide.mk"

# control files
CMDLNFILE := Makefile.cmd
DEBUGFILE := Makefile.dbg
PROFILEFILE := Makefile.prf
FORCEFILE := Makefile.frc

# C and C++ flags
DEBUGFLAG := -g
PROFILEFLAG := -pg

# DOS commands
# rm.exe and touch.exe can be found in fil316b.zip
RM := rm -f
# this version of touch must create the file if it does not already exist
TOUCH := touch
# rhgdb.exe can be found in rhide14b.zip
GDB := rhgdb
PROF := gprof

# read command-line parameters
ifeq ($(CMDLNFILE), $(wildcard $(CMDLNFILE)))
 CMDLN := $(shell type $(CMDLNFILE))
else
 CMDLN :=
endif

# check debugging toggle
ifeq ($(DEBUGFILE),$(wildcard $(DEBUGFILE)))
# CFLAGS += $(DEBUGFLAG)
# CXXFLAGS += $(DEBUGFLAG)
endif

# check profiling toggle
ifeq ($(PROFILEFILE),$(wildcard $(PROFILEFILE)))
# CFLAGS += $(PROFILEFLAG)
# CXXFLAGS += $(PROFILEFLAG)
# LDFLAGS += $(PROFILEFLAG)
endif

*.o: $(FORCEFILE)

include /c/Makefile.implicit

# cmdln uses the command echoread, which has the following source code:
# // echoread.cc - copies a line from stdin to stdout, kind of like 'echo'.
# #include <iostream.h>
#
# main()
# {
# 	char s[256];
# 	cin.getline(s,256);
# 	cout << s;
# 	return 0;
# }
# which can be compiled via: gxx echoread.cc -o echoread.exe
cmdln:
	@echo Current command-line options: $(CMDLN)
	@echo Enter new options:
	@echoread > $(CMDLNFILE)

# EXE must be specified on the make command-line
debug:
ifeq (,$(findstring $(DEBUGFLAG),$(CFLAGS)))
	@$(TOUCH) $(DEBUGFILE)
	@echo Debugging is now ON.
	@$(TOUCH) $(FORCEFILE)
endif
# need recursive make so debugging flag can be added
	$(MAKE) $(EXE)
	$(GDB) $(EXE) $(CMDLN)

# EXE must be specified on the make command-line
profile:
ifeq (,$(findstring $(PROFILEFLAG),$(CFLAGS)))
	@$(TOUCH) $(PROFILEFILE)
	@echo Profiling is now ON.
	@$(TOUCH) $(FORCEFILE)
endif
# need recursive make so profiling flag can be added
	@$(MAKE) $(EXE) -s
	@$(PROF) $(EXE) $(CMDLN)

# EXE must be specified on the make command-line
run:
	$(EXE) $(CMDLN)

showToggles:
ifneq (,$(findstring $(DEBUGFLAG),$(CFLAGS)))
	@echo Debugging is ON.
else
	@echo Debugging is OFF.
endif
ifneq (,$(findstring $(PROFILEFLAG),$(CFLAGS)))
	@echo Profiling is ON.
else
	@echo Profiling is OFF.
endif

toggleDebug:
ifneq (,$(findstring $(DEBUGFLAG),$(CFLAGS)))
	@$(RM) $(DEBUGFILE)
	@echo Debugging is now OFF.
else
	@$(TOUCH) $(DEBUGFILE)
	@echo Debugging is now ON.
endif
	@$(TOUCH) $(FORCEFILE)

toggleProfile:
ifneq (,$(findstring $(PROFILEFLAG),$(CFLAGS)))
	@$(RM) $(PROFILEFILE)
	@echo Profiling is now OFF.
else
	@$(TOUCH) $(PROFILEFILE)
	@echo Profiling is now ON.
endif
	@$(TOUCH) $(FORCEFILE)

--------------DEA78C44A988999FBFFBC4BD--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019