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

The Makefile doesn't work #1

Closed
angelog0 opened this issue Sep 5, 2018 · 4 comments
Closed

The Makefile doesn't work #1

angelog0 opened this issue Sep 5, 2018 · 4 comments

Comments

@angelog0
Copy link

angelog0 commented Sep 5, 2018

It works in

make
make all

but fails in building the examples as in:

$ make window
make: ***  Nessuna regola per generare l'obiettivo "examples//.f90", necessario per "window".  Arresto.

(It means: No rule to generate the target "examples//.f90", needed for "window". Stopping.)

Are we sure that using $* here

$(WINDOW): $(DIR)/$*/$*.f90 $(SDL_OBJ)

is the right thing?

@angelog0
Copy link
Author

angelog0 commented Sep 5, 2018

At the end, I applied this workaround:

$ diff -Naur Makefile~ Makefile
--- Makefile~	2018-09-05 14:28:42.458089100 +0200
+++ Makefile	2018-09-05 15:50:22.648807500 +0200
@@ -49,28 +49,28 @@
 $(TTF_OBJ):
 	$(FC) -c $(TTF_SRC)
 
-$(WINDOW): $(DIR)/$*/$*.f90 $(SDL_OBJ)
+$(WINDOW): $(DIR)/$(WINDOW)/$(WINDOW).f90 $(SDL_OBJ)
 	$(FC) $(CFLAGS) -o $@ $? $(LDFLAGS)
 
-$(IMAGE): $(DIR)/$*/$*.f90 $(SDL_OBJ)
+$(IMAGE): $(DIR)/$(IMAGE)/$(IMAGE).f90 $(SDL_OBJ)
 	$(FC) $(CFLAGS) -o $@ $? $(LDFLAGS)
 
-$(EVENTS): $(DIR)/$*/$*.f90 $(SDL_OBJ)
+$(EVENTS): $(DIR)/$(EVENTS)/$(EVENTS).f90 $(SDL_OBJ)
 	$(FC) $(CFLAGS) -o $@ $? $(LDFLAGS)
 
-$(SCALING): $(DIR)/$*/$*.f90 $(SDL_OBJ)
+$(SCALING): $(DIR)/$(SCALING)/$(SCALING).f90 $(SDL_OBJ)
 	$(FC) $(CFLAGS) -o $@ $? $(LDFLAGS)
 
-$(TRANSLUCENCE): $(DIR)/$*/$*.f90 $(SDL_OBJ)
+$(TRANSLUCENCE): $(DIR)/$(TRANSLUCENCE)/$(TRANSLUCENCE).f90 $(SDL_OBJ)
 	$(FC) $(CFLAGS) -o $@ $? $(LDFLAGS)
 
-$(BOUNCE): $(DIR)/$*/$*.f90 $(SDL_OBJ) $(IMG_OBJ)
+$(BOUNCE): $(DIR)/$(BOUNCE)/$(BOUNCE).f90 $(SDL_OBJ) $(IMG_OBJ)
 	$(FC) $(CFLAGS) -o $@ $? $(LDFLAGS) -lSDL2_image
 
-$(MUSIC): $(DIR)/$*/$*.f90 $(SDL_OBJ) $(MIX_OBJ) $(TTF_OBJ)
+$(MUSIC): $(DIR)/$(MUSIC)/$(MUSIC).f90 $(SDL_OBJ) $(MIX_OBJ) $(TTF_OBJ)
 	$(FC) $(CFLAGS) -o $@ $? $(LDFLAGS) -lSDL2_mixer -lSDL2_ttf
 
-$(TEXT): $(DIR)/$*/$*.f90 $(SDL_OBJ) $(TTF_OBJ)
+$(TEXT): $(DIR)/$(TEXT)/$(TEXT).f90 $(SDL_OBJ) $(TTF_OBJ)
 	$(FC) $(CFLAGS) -o $@ $? $(LDFLAGS) -lSDL2_ttf
 
 .PHONY: clean

All examples build and run but most crash (on exit, when one clicks the X to close the window: strangely this occurs only on GNU/Linux not on MSYS2/MINGW64) with:

double free or corruption (out)

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
#0  0x7fa7fa5b731a
#1  0x7fa7fa5b6503
#2  0x7fa7fa1e9f1f
#3  0x7fa7fa1e9e97
#4  0x7fa7fa1eb800
#5  0x7fa7fa234896
#6  0x7fa7fa23b909
#7  0x7fa7fa242e74
#8  0x7fa7fa9e1a8e
#9  0x55a6832aab61
#10  0x55a6832aabbd
#11  0x7fa7fa1ccb96
#12  0x55a6832aa5a9
#13  0xffffffffffffffff
Annullato

or (text)

munmap_chunk(): invalid pointer

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
[...]
Annullato

It seems that only window and bounce do not crash.

@interkosmos
Copy link
Owner

It seems you are using GNU make. But the Makefile is written for BSD make. After you have installed BSD make, run bmake.

@angelog0
Copy link
Author

angelog0 commented Sep 5, 2018

@interkosmos, I would suggest you make the Makefile compliant with GNU make. Maybe BSD make is on macOS but other *nix systems have GNU make by default...

@interkosmos
Copy link
Owner

It depends on the point of view: on BSD derivates one has to install GNU make (gmake), on Linux one has to install BSD make (bmake). Probably, you are right. I have not much experience with GNU make, but try to migrate to it in future.

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

2 participants