From a2948e28b91623b239826f80616471cf38fd1f65 Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Mon, 25 Feb 2002 18:43:52 +0000 Subject: [PATCH] Various makefile related changes. --- .cvsignore | 2 ++ Makefile | 20 ++++++++++++++++++-- data/Makefile | 7 +++++++ main.c | 4 ++++ modify/.cvsignore | 1 + modify/pack.c | 11 ++++++----- modify/unpack.c | 5 ++--- sdl/.cvsignore | 1 + 8 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 .cvsignore create mode 100644 data/Makefile create mode 100644 modify/.cvsignore create mode 100644 sdl/.cvsignore diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..26cb3fa --- /dev/null +++ b/.cvsignore @@ -0,0 +1,2 @@ +*.o *.exe +jnb.tmpmusic.mod stdout.txt stderr.txt diff --git a/Makefile b/Makefile index cf6a41e..ab73464 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,30 @@ OBJS = sdl/gfx.o sdl/interrpt.o sdl/sound.o sdl/input.o fireworks.o main.o menu.o TARGET = jumpnbump - CC = gcc CFLAGS = -Wall -O2 -ffast-math -funroll-loops -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DUSE_SDL -DNDEBUG -I. $(shell sdl-config --cflags) LIBS = -lm $(shell sdl-config --libs) -lSDL_mixer +.PHONY: data + +all: $(TARGET) pack unpack data + $(TARGET): $(OBJS) $(CC) $(LFLAGS) -o $(TARGET) $(OBJS) $(LIBS) +pack: modify/pack.o + $(CC) $(LFLAGS) -o pack modify/pack.o $(LIBS) + +unpack: modify/unpack.o + $(CC) $(LFLAGS) -o unpack modify/unpack.o $(LIBS) + +data: pack + $(MAKE) -C data + clean: - rm -f $(TARGET) *.o sdl/*.o *~ log + rm -f $(TARGET) pack unpack *.o sdl/*.o *~ log modify/*.o + $(MAKE) -C data clean +install: + install -o root -g games -m 755 $(TARGET) $(DESTDIR)/usr/games/$(TARGET) + install -o root -g games -m 644 data/jumpbump.dat $(DESTDIR)/usr/share/jumpnbump/jumpbump.dat diff --git a/data/Makefile b/data/Makefile new file mode 100644 index 0000000..d0c8b2d --- /dev/null +++ b/data/Makefile @@ -0,0 +1,7 @@ +all: jumpbump.dat + +jumpbump.dat: bump.mod calib.dat death.smp fly.smp font.gob jump.mod jump.smp levelmap.txt level.pcx mask.pcx menu.pcx menumask.pcx numbers.gob objects.gob rabbit.gob scores.mod splash.smp spring.smp + ../pack -o jumpbump.dat bump.mod calib.dat death.smp fly.smp font.gob jump.mod jump.smp levelmap.txt level.pcx mask.pcx menu.pcx menumask.pcx numbers.gob objects.gob rabbit.gob scores.mod splash.smp spring.smp + +clean: + rm -f jumpbump.dat diff --git a/main.c b/main.c index f5ae932..3dc783f 100644 --- a/main.c +++ b/main.c @@ -1834,7 +1834,11 @@ int init_program(int argc, char *argv[], char *pal) memset(&main_info, 0, sizeof(main_info)); +#ifdef _WIN32 strcpy(datfile_name, "data/jumpbump.dat"); +#else + strcpy(datfile_name, "/usr/share/jumpnbump/jumpbump.dat"); +#endif force2 = force3 = 0; diff --git a/modify/.cvsignore b/modify/.cvsignore new file mode 100644 index 0000000..5761abc --- /dev/null +++ b/modify/.cvsignore @@ -0,0 +1 @@ +*.o diff --git a/modify/pack.c b/modify/pack.c index 76f1cc6..ff0b130 100644 --- a/modify/pack.c +++ b/modify/pack.c @@ -33,18 +33,19 @@ #include #include #include -#ifndef _MSC_VER +#ifndef _WIN32 #include +#endif +#ifndef _MSC_VER #include #else #include -typedef unsigned int u_int32_t; #endif typedef struct { char filename[12]; - u_int32_t offset; - u_int32_t size; + unsigned int offset; + unsigned int size; } DirEntry; int main(int argc, char **argv) @@ -56,7 +57,7 @@ int main(int argc, char **argv) char *outfile = NULL; int offset = 0; -#ifndef _MSC_VER +#ifndef _WIN32 while ((c = getopt(argc, argv, "o:")) != EOF) { switch (c) { case 'o': diff --git a/modify/unpack.c b/modify/unpack.c index cc1c969..f8051ca 100644 --- a/modify/unpack.c +++ b/modify/unpack.c @@ -36,13 +36,12 @@ #include #else #include -typedef unsigned int u_int32_t; #endif typedef struct { char filename[12]; - u_int32_t offset; - u_int32_t size; + unsigned int offset; + unsigned int size; } DirEntry; int main(int argc, char **argv) diff --git a/sdl/.cvsignore b/sdl/.cvsignore new file mode 100644 index 0000000..5761abc --- /dev/null +++ b/sdl/.cvsignore @@ -0,0 +1 @@ +*.o -- 2.39.2