Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ vs2019_project/pt2-clone/Debug/pt2-clone.vcxproj.FileListAbsolute.txt
*.enc
release/macos/pt2-clone-macos.app/Contents/MacOS/pt2-clone-macos
pt_pal_editor/vs2019_project/pt_pal_editor/x64/Debug/pt_pal_editor.vcxproj.FileListAbsolute.txt

/CMakeCache.txt
/CMakeFiles/
/build/
/cmake_install.cmake
release/other/pt2-clone
/src/**/*.o
4 changes: 1 addition & 3 deletions HOW-TO-COMPILE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Compiled Windows/macOS binaries are always available at 16-bits.org/pt2.php
Fedora: gcc gcc-c++ alsa-lib-devel SDL2-devel
Others: www.google.com (you want gcc, g++ (or c++), alsa dev and SDL2 dev)
2. Compile the PT2 clone: (folder: "pt2-clone")
chmod +x make-linux.sh (only needed once)
./make-linux.sh
make -j2
3. Copy pt2-clone/release/other/protracker.ini to ~/.config/protracker/
(or ~/.protracker/).
Make sure there are no config files in the same path as the
Expand All @@ -33,7 +32,6 @@ Compiled Windows/macOS binaries are always available at 16-bits.org/pt2.php
2. Download the SDL 2 framework at https://www.libsdl.org
3. Inside the package, copy SDL2.framework to /Library/Frameworks/
4. Compile the PT2 clone: (folder: "pt2-clone")
chmod +x make-macos.sh (only needed once)
./make-macos.sh
5. If you have more than one user in your OS, copy
pt2-clone/release/macos/protracker.ini to ~/.config/protracker/
Expand Down
60 changes: 60 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
CC ?= gcc
DESTDIR ?= /usr/local

HAS_FLAC ?= 1
DEFINES ?=

CFLAGS ?= \
-O3 -march=native -mtune=native \
-Wall -Wextra \
-Wshadow -Winit-self -Wunused -Wunreachable-code \
-Wno-missing-field-initializers -Wno-unused-result \
-Wno-strict-aliasing -Wno-stringop-overflow

LDFLAGS ?= -lSDL2 -lm

SRC = $(wildcard \
src/gfx/*.c \
src/modloaders/*.c \
src/smploaders/*.c \
)

ifeq ($(HAS_FLAC), 1)
DEFINES += -DHAS_LIBFLAC
SRC += $(wildcard src/libflac/*.c)
endif

SRC += $(wildcard src/*.c)

ifndef DEBUG
DEFINES += -DNDEBUG
endif

OUT_DIR = release/other
OUT_FILE = $(OUT_DIR)/pt2-clone

.PHONY: all clean

all: $(OUT_FILE)

OBJ = $(SRC:%.c=%.o)

$(OUT_FILE): $(OBJ)
@mkdir -p $(OUT_DIR)
$(CC) $(OBJ) $(LDFLAGS) -o $(OUT_FILE)
@echo "Done. The executable can be found in '$(OUT_DIR)' if everything went well."

%.o: %.c
@echo "CC $<"
@$(CC) $(DEFINES) $(CFLAGS) -c $< -o $@

clean:
-rm -f $(OUT_FILE)
-rm -f $(SRC:%.c=%.o)

USER_HOME ?= $(shell getent passwd $(SUDO_USER) | cut -d: -f6)
USER_HOME := $(if $(USER_HOME),$(USER_HOME),$(HOME))

install: $(OUT_FILE)
@install -v $(OUT_FILE) $(DESTDIR)/bin/
@install -vD $(OUT_DIR)/protracker.ini $(USER_HOME)/.config/protracker/protracker.ini
9 changes: 0 additions & 9 deletions make-linux-noflac.sh

This file was deleted.

9 changes: 0 additions & 9 deletions make-linux.sh

This file was deleted.

Empty file modified make-macos.sh
100644 → 100755
Empty file.