# Makefile for cnotes - Turbo C++ 3.0 on DOS/Win32 # Strict C89/ANSI compliant build # # Usage from DOS/Windows command line: # make -f makefile.tc # # Or rename to MAKEFILE and run: # make # # Turbo C++ 3.0 should be in PATH, or adjust CC path below. CC = tcc CFLAGS = -A -w -ml -I.\include # -A = ANSI keywords only # -w = Enable all warnings # -ml = Large memory model (for DOS) # -I = Include path SRCDIR = src INCDIR = include BUILDDIR = BUILD INSTALL_FILE = INSTALL.BAT README_DOS = READ-DOS.TXT .c.obj: $(CC) $(CFLAGS) -c -o$*.obj $< # ──────────────────────────────────────────────── # Main targets – split to avoid long command lines # ──────────────────────────────────────────────── all: build-exes build-support-files build-exes: $(BUILDDIR)\cnadd.exe \ $(BUILDDIR)\cndump.exe \ $(BUILDDIR)\cncount.exe \ $(BUILDDIR)\cndel.exe \ $(BUILDDIR)\cnfind.exe \ $(BUILDDIR)\cnhelp.exe build-support-files: $(BUILDDIR)\$(INSTALL_FILE) \ $(BUILDDIR)\$(README_DOS) $(BUILDDIR): if not exist $(BUILDDIR) mkdir $(BUILDDIR) # Individual exe rules (unchanged) $(BUILDDIR)\cnadd.exe: $(SRCDIR)\cnadd.c $(INCDIR)\platform.h $(INCDIR)\config.h if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cnadd.exe $(SRCDIR)\cnadd.c $(BUILDDIR)\cndump.exe: $(SRCDIR)\cndump.c $(INCDIR)\platform.h $(INCDIR)\config.h if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cndump.exe $(SRCDIR)\cndump.c $(BUILDDIR)\cncount.exe: $(SRCDIR)\cncount.c $(INCDIR)\platform.h $(INCDIR)\config.h if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cncount.exe $(SRCDIR)\cncount.c $(BUILDDIR)\cndel.exe: $(SRCDIR)\cndel.c $(INCDIR)\platform.h $(INCDIR)\config.h if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cndel.exe $(SRCDIR)\cndel.c $(BUILDDIR)\cnfind.exe: $(SRCDIR)\cnfind.c $(INCDIR)\platform.h $(INCDIR)\config.h if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cnfind.exe $(SRCDIR)\cnfind.c $(BUILDDIR)\cnhelp.exe: $(SRCDIR)\cnhelp.c if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cnhelp.exe $(SRCDIR)\cnhelp.c $(BUILDDIR)\$(INSTALL_FILE): $(INSTALL_FILE) if not exist $(BUILDDIR) mkdir $(BUILDDIR) copy $(INSTALL_FILE) $(BUILDDIR)\$(INSTALL_FILE) $(BUILDDIR)\$(README_DOS): $(README_DOS) if not exist $(BUILDDIR) mkdir $(BUILDDIR) copy $(README_DOS) $(BUILDDIR)\$(README_DOS) clean: if exist $(BUILDDIR)\*.exe del $(BUILDDIR)\*.exe if exist $(BUILDDIR)\*.obj del $(BUILDDIR)\*.obj if exist $(BUILDDIR)\$(INSTALL_FILE) del $(BUILDDIR)\$(INSTALL_FILE) if exist $(BUILDDIR)\$(README_DOS) del $(BUILDDIR)\$(README_DOS) if exist $(BUILDDIR) rmdir $(BUILDDIR)