diff --git a/compiler/amxxpc/Makefile b/compiler/amxxpc/Makefile new file mode 100755 index 00000000..09948bd4 --- /dev/null +++ b/compiler/amxxpc/Makefile @@ -0,0 +1,46 @@ +#(C)2004-2005 AMX Mod X Development Team +# Makefile written by David "BAILOPAN" Anderson + +### EDIT BELOW FOR OTHER PROJECTS ### + +OPT_FLAGS = -O3 -fno-rtti -funroll-loops -s -pipe +DEBUG_FLAGS = -g -ggdb3 +CPP = gcc +BINARY = amxxpc + +OBJECTS = amx.cpp amxxpc.cpp + +LINK = -lz + +INCLUDE = -I. -L. + +ifeq "$(DEBUG)" "true" + BIN_DIR = Debug + CFLAGS = $(DEBUG_FLAGS) +else + BIN_DIR = Release + CFLAGS = $(OPT_FLAGS) +endif + +CFLAGS += -DLINUX -DNDEBUG -Wno-deprecated -fno-exceptions -DHAVE_STDINT_H -DAMX_ANSIONLY + +OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o) + +$(BIN_DIR)/%.o: %.cpp + $(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $< + +all: + mkdir -p $(BIN_DIR) + $(MAKE) amxxpc + +amxxpc: $(OBJ_LINUX) + $(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -ldl -lm -o$(BIN_DIR)/$(BINARY) + +default: all + +clean: + rm -rf Release/*.o + rm -rf Release/$(BINARY) + rm -rf Debug/*.o + rm -rf Debug/$(BINARY) + diff --git a/compiler/amxxpc/amxxpc.cpp b/compiler/amxxpc/amxxpc.cpp index 28a8a3f4..a212e1d8 100755 --- a/compiler/amxxpc/amxxpc.cpp +++ b/compiler/amxxpc/amxxpc.cpp @@ -5,6 +5,7 @@ #include #include #endif +#include #include "zlib.h" #include "amx.h" #include "amxxpc.h" @@ -39,7 +40,7 @@ int main(int argc, char **argv) if (!sc32) { #ifdef __linux__ - printf("32bit compiler failed to link: %p|%p.\n",sc32, sc_printf); + printf("32bit compiler failed to link: %p.\n",sc32); #else printf("32bit compiler failed to link: %d.\n", GetLastError()); #endif @@ -117,7 +118,7 @@ int main(int argc, char **argv) if (!sc64) { #ifdef __linux__ - sc_printf("64bit compiler failed to link: %s.\n", dlerror()); + printf("64bit compiler failed to link: %s.\n", dlerror()); #else printf("64bit compiler failed to link: %d.\n", GetLastError()); #endif diff --git a/compiler/amxxpc/getch.h b/compiler/amxxpc/getch.h new file mode 100755 index 00000000..71cdd83b --- /dev/null +++ b/compiler/amxxpc/getch.h @@ -0,0 +1,15 @@ +/* Extremely inefficient but portable POSIX getch(), see getch.c */ +#ifndef GETCH_H +#define GETCH_H + +#if defined __cplusplus + extern "C" { +#endif +int getch(void); +int kbhit(void); + +#if defined __cplusplus +} +#endif + +#endif /* GETCH_H */ diff --git a/compiler/amxxpc/libz.a b/compiler/amxxpc/libz.a new file mode 100755 index 00000000..56a9c261 Binary files /dev/null and b/compiler/amxxpc/libz.a differ