2 次代码提交 b0060b8af6 ... 6200d9ee38

作者 SHA1 备注 提交日期
  CYBERDEV 6200d9ee38 Update Makefile 2 月之前
  CYBERDEV 5bcee364ae Fix debug script printing (stupid mistakes) 2 月之前
共有 2 个文件被更改,包括 35 次插入17 次删除
  1. 33 15
      Makefile
  2. 2 2
      src/wisescript.c

+ 33 - 15
Makefile

@@ -1,20 +1,38 @@
-CC=gcc
-CFLAGS=-lz
-CFLAGS+=-Wall -fanalyzer
+CC = gcc
+CFLAGS := -lz
+CFLAGS += -Wall -fanalyzer
+
+OBJECTS = src/rewise.o \
+		  src/print.o \
+		  src/reader.o \
+		  src/pefile.o \
+		  src/pkzip.o \
+		  src/wisescript.o \
+		  src/wiseoverlay.o
+
+
 
 all: rewise
 
-rewise: src/rewise.c \
-        src/print.c src/print.h \
-        src/reader.c src/reader.h \
-        src/pefile.c src/pefile.h \
-        src/wisescript.c src/wisescript.c \
-        src/wiseoverlay.c src/wiseoverlay.h \
-        src/version.h \
-        src/errors.h
-	$(CC) src/rewise.c src/print.c src/reader.c \
-          src/pefile.c src/wisescript.c src/wiseoverlay.c -o $@ -I./src \
-          $(CFLAGS)
+rewise: $(OBJECTS)
+	$(CC) -o $@ -I./src $(CFLAGS) $^
+
+debug: CFLAGS += -g -DREWISE_DEBUG
+debug: rewise
 
 clean:
-	rm -f rewise
+	rm -f src/*.o rewise
+
+# Make sure header files are evaluated against changes
+$(OBJECTS): src/print.h \
+            src/reader.h \
+            src/pefile.h \
+            src/pkzip.h \
+            src/wisescript.h \
+            src/wiseoverlay.h \
+            src/version.h \
+            src/errors.h
+
+.PHONY: all clean
+
+

+ 2 - 2
src/wisescript.c

@@ -1173,7 +1173,7 @@ void printWiseScriptUnknown0x0B(WiseScriptUnknown0x0B * data) {
 }
 
 void printWiseScriptUnknown0x0C(WiseScriptUnknown0x0C * data) {
-  printf("0x0B %02X '%s' '%s'\n", data->unknown_1, data->unknownString_1,
+  printf("0x0C %02X '%s' '%s'\n", data->unknown_1, data->unknownString_1,
          data->unknownString_2);
 }
 
@@ -1222,7 +1222,7 @@ void printWiseScriptUnknown0x1E(WiseScriptUnknown0x1E * data) {
 }
 
 void printWiseScriptUnknown0x23(WiseScriptUnknown0x23 * data) {
-  printf("0x1C %02X '%s' '%s'\n", data->unknown_1, data->unknownString_1,
+  printf("0x23 %02X '%s' '%s'\n", data->unknown_1, data->unknownString_1,
          data->unknownString_2);
 }