Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running make does nothing #583

Open
absolutelynothinghere opened this issue Jan 12, 2024 · 7 comments
Open

Running make does nothing #583

absolutelynothinghere opened this issue Jan 12, 2024 · 7 comments

Comments

@absolutelynothinghere
Copy link

I tried running make and make sdl but there's no output, no errors, nothing.

@LIJI32
Copy link
Owner

LIJI32 commented Jan 12, 2024

Any more details? What version of make (make -v)? What operating system?

@absolutelynothinghere
Copy link
Author

I'm using GNU make 4.4.1 on Linux

@LIJI32
Copy link
Owner

LIJI32 commented Jan 13, 2024

This is odd, the same version of GNU Make works on my VM. Can you try adding $(error Test) as the first line in the Makefile and see if it prints?

@absolutelynothinghere
Copy link
Author

Yes it prints:

Makefile:1: *** Test. Stop.

@orbea
Copy link
Contributor

orbea commented Mar 3, 2024

@absolutelynothinghere does make V=1 make a difference?

@absolutelynothinghere
Copy link
Author

absolutelynothinghere commented Mar 10, 2024

does make V=1 make a difference?

No.

@absolutelynothinghere
Copy link
Author

I seem to have forgotten to update this issue, but I basically wrote an entirely new Makefile after trying to debug the current one. The new Makefile is 60 lines long and POSIX compliant so it does not depend on GNU Make... Note that it only compiles the SameBoy executable, not the boot ROMs.

### Variables

include version.mk
COPYRIGHT_YEAR = 2023
PREFIX = /usr/local
DATA_DIR = $(PREFIX)/share/sameboy/

WARNINGS = \
    -Werror -Wall -Wno-unknown-warning -Wno-unknown-warning-option \
    -Wno-missing-braces -Wno-nonnull -Wno-unused-result -Wno-strict-aliasing \
    -Wno-multichar -Wno-int-in-bool-context -Wno-format-truncation
DEFINES = \
    -DGB_INTERNAL -D_USE_MATH_DEFINES -D_GNU_SOURCE -DNDEBUG \
    -DDATA_DIR="\"$(DATA_DIR)\"" -DGB_VERSION="\"$(VERSION)\"" \
    -DGB_COPYRIGHT_YEAR="\"$(COPYRIGHT_YEAR)\""
PKG_CONFIG = pkg-config

CC      =   cc
CFLAGS  =   -I. -O3 -std=gnu11 -ffast-math $(WARNINGS) $(DEFINES) \
            `$(PKG_CONFIG) --cflags sdl2 gl`
LDFLAGS =   `$(PKG_CONFIG) --libs   sdl2 gl` -lm -ldl -s

### Sources

CORE_SOURCES = \
    Core/workboy.c Core/timing.c Core/symbol_hash.c Core/sm83_disassembler.c \
    Core/sm83_cpu.c Core/sgb.c Core/save_state.c Core/rumble.c Core/rewind.c \
    Core/random.c Core/printer.c Core/memory.c Core/mbc.c Core/joypad.c \
    Core/gb.c Core/display.c Core/debugger.c Core/cheats.c Core/camera.c \
    Core/apu.c

OPEN_DIALOG = OpenDialog/gtk.c

SDL_SOURCES = \
    SDL/utils.c SDL/shader.c SDL/opengl_compat.c SDL/main.c SDL/gui.c \
    SDL/font.c SDL/console.c SDL/configuration.c SDL/audio.c SDL/audio/sdl.c \
    $(OPEN_DIALOG)

OBJECTS = $(CORE_SOURCES:.c=.o) $(SDL_SOURCES:.c=.o)

EXE = sameboy

### Targets

.SUFFIXES: .c .o
.c.o:
	$(CC) $(CFLAGS) -c $< -o $@

$(EXE): $(OBJECTS)
	$(CC) $(OBJECTS) -o $@ $(LDFLAGS)
	
clean:
	rm -f $(OBJECTS) $(EXE)

install: $(EXE)
	@mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(DATA_DIR)
	cp $(EXE) $(DESTDIR)$(PREFIX)/bin
	cp -R Misc/Palettes Misc/registers.sym Shaders  $(DESTDIR)$(DATA_DIR)
	cp -R SDL/background.bmp LICENSE                $(DESTDIR)$(DATA_DIR)
	echo Please copy the boot ROMs to $(DESTDIR)$(DATA_DIR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants