From 5e2593f7df0489b2502528747ac86d32e00dac57 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Mon, 12 Jun 2006 20:36:32 +0000 Subject: [PATCH] move towards using system CPP buildcfg.txt: rework OR relationship to be CPP-compliant remove tools/simplecpp Makefile: CPP=/usr/bin/cpp stop redundant rebuilds remove all from PHONY in lumps/cph/misc-lumps/Makefile clean up build output add a newline to lumps/cph/misc-lumps/colormap.pl add a clean target, to: ./Makefile ./lumps/Makefile ./lumps/cph/misc-lumps/Makefile --- Makefile | 6 +- buildcfg.txt | 9 +- lumps/Makefile | 2 + lumps/cph/misc-lumps/Makefile | 5 +- lumps/cph/misc-lumps/colormap.pl | 1 + tools/simplecpp | 147 ------------------------------- 6 files changed, 15 insertions(+), 155 deletions(-) delete mode 100755 tools/simplecpp diff --git a/Makefile b/Makefile index 87ce6537..e3e4a5b6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ WADS_DIR=wads/ -CPP=tools/simplecpp +CPP=/usr/bin/cpp DEUTEX=deutex DEUTEX_BASIC_ARGS=-fullsnd -rate accept -rgb 0 255 255 DEUTEX_ARGS=$(DEUTEX_BASIC_ARGS) -doom2 bootstrap/ @@ -139,4 +139,6 @@ $(WADS_DIR)/doom1.wad : wadinfo_sw.txt force $(WADS_DIR) dist : $(OBJS) ./makepkgs $(OBJS) - +clean: + rm -f ./wadinfo.txt deutex.log + make -C lumps clean diff --git a/buildcfg.txt b/buildcfg.txt index 788f764a..81f0ce96 100644 --- a/buildcfg.txt +++ b/buildcfg.txt @@ -14,6 +14,7 @@ #endif #ifdef DOOM2 +#define ULTDOOM_OR_DOOM2 #undef SHAREWARE #undef ULTDOOM #endif @@ -24,6 +25,7 @@ #ifdef ULTDOOM #undef SHAREWARE +#define ULTDOOM_OR_DOOM2 #endif ; List of levels @@ -932,12 +934,9 @@ CWILV30 0 0 CWILV31 0 0 #endif /* #ifdef DOOM2 */ -#ifdef ULTDOOM || DOOM2 - +#ifdef ULTDOOM_OR_DOOM2 ; interpic is used by ultimate doom and doom2 - INTERPIC 0 0 - #endif ; sprites list @@ -949,7 +948,7 @@ INTERPIC 0 0 ; In FreeDM, all monsters are replaced by a simple silhouette. When ; the monster is killed, it just disappears. These are all single ; frame graphics. It is assumed that most deathmatch levels are played -; without monsters, but it's helpful to have these silhouettes +; without monsters, but it is helpful to have these silhouettes ; for people that forgot to set -nomonsters. BOS2A0 = nomonst diff --git a/lumps/Makefile b/lumps/Makefile index 93084ecc..22661940 100644 --- a/lumps/Makefile +++ b/lumps/Makefile @@ -9,3 +9,5 @@ freedoom.lmp: force force: +clean: + make -C cph/misc-lumps clean diff --git a/lumps/cph/misc-lumps/Makefile b/lumps/cph/misc-lumps/Makefile index 1b45dfab..36060196 100644 --- a/lumps/cph/misc-lumps/Makefile +++ b/lumps/cph/misc-lumps/Makefile @@ -14,4 +14,7 @@ dist : doom-misc-lumps-$(VERSION).tar.gz doom-misc-lumps-$(VERSION).tar.gz : $(SOURCES) tar czf $@ $(SOURCES) -.PHONY : all dist +clean: + rm -f playpal.lmp colormap.lmp doom-misc-lumps-$(VERSION).tar.gz + +.PHONY : dist clean diff --git a/lumps/cph/misc-lumps/colormap.pl b/lumps/cph/misc-lumps/colormap.pl index a9711eb3..f43068fa 100755 --- a/lumps/cph/misc-lumps/colormap.pl +++ b/lumps/cph/misc-lumps/colormap.pl @@ -77,6 +77,7 @@ foreach my $i (0..31) { print map { pack("C",$_) } @$p; print STDERR "."; } +print STDERR "\n"; # And now INVERSECOLORMAP { my $p = darkenedpalette( diff --git a/tools/simplecpp b/tools/simplecpp deleted file mode 100755 index f88ddde3..00000000 --- a/tools/simplecpp +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env perl -# -# simple cpp-style preprocessor -# -# By Simon Howard -# -# Understands: -# -# #define NAME -# -# Set an option -# You can use -D on the command line too -# -# #undef NAME -# -# Unset an option if it is set -# -# #if .. #endif / #ifdef .. #endif -# -# Specify a list of options set, eg #ifdef DOOM2 || ULTDOOM || SHAREWARE -# The block is only displayed if one of the options is set -# -# #ifn .. #endif / #ifndef .. #endif -# -# Similarly specify a list of options -# The block is displayed if none of the options are set -# -# #include "filename" -# -# include the contents of a file - -use strict; - -my @readstack; -my %defines; - -sub parse_cmdline { - foreach (@ARGV) { - if (/^-D/) { - my ($define) = /^-D(.*)$/; - $defines{$define} = 1; - } - } -} - -# add contents of stdin to read stack - -sub read_stdin { - my @lines = ; - chomp @lines; - - @readstack = (@readstack, reverse(@lines)); -} - -# add contents of a file to stack - -sub read_file { - my ($filename) = @_; - - open(FILE, $filename) or die "cant open $filename: $!"; - my @lines = ; - close(FILE); - - chomp @lines; - @readstack = (@readstack, reverse(@lines)); -} - -# recursive block reading function -# if 'ignore' argument is 1, contents are ignored - -sub readblock { - my ($ignore) = @_; - - while (scalar @readstack > 0) { - $_ = pop @readstack; - - next if (/^\s*$/); - - if (/^\#include\s+\".*\"\s*$/ ) { - if (!$ignore) { - my ($filename) = /^\#include\s+\"(.*)\"\s*/; - read_file $filename; - } - } elsif (/^\#define\s/ ) { - if (!$ignore) { - my ($name) = /^\#define\s*(\w+)/; - $defines{$name} = 1; - } - } elsif (/^\#undef\s/ ) { - if (!$ignore) { - my ($name) = /^\#undef\s*(\w+)/; - $defines{$name} = undef; - } - } elsif (/^\#(if|ifdef|ifn|ifndef)\s/) { - my ($type, $defines) = /^\#(\w+)\s+(.*)/; - $defines =~ s/\s*$//; - - my @definelist = split(/\s*\|\|\s*/, $defines); - - my $ev; - - if ($type =~ /^(if|ifdef)$/) { - $ev = 0; - - foreach (@definelist) { - $ev = 1 if $defines{$_}; - } - } elsif ($type =~ /^(ifn|ifndef)$/) { - $ev = 1; - - foreach (@definelist) { - $ev = 0 if $defines{$_}; - } - } else { die "what type?"; } - - my $result = readblock($ignore || !$ev); - - die if $result == -1; - - if ($result == 1) { - # block ended on an else - # call again for the second block - - my $result = readblock($ignore || $ev); - - die if $result != 0; - } - - } elsif (/^\#endif/) { - return 0; - } elsif (/^\#else/) { - return 1; - } elsif (/^\#/) { - die "invalid # command"; - } else { - print "$_\n" if !$ignore; - } - - } - - return -1; -} - -parse_cmdline; -read_stdin; -die if (readblock(0) != -1); -