I am trying to compile a program and I have to set the paths to the NETCDF inc and lib directories in the Makefile as well as set the gfortran and c compiler settings. The variables were already named as shown below, it just told me to edit the paths/options which I have tried to do. Here is what I have for my netcdf inc and lib, as well as the hdf5:
NETCDFINC = -I$(NETCDFF_INCDIR) -I$(NETCDFC_INCDIR)
NETCDFLIB = -Wl,-rpath=$(NETCDFF_LIBDIR) -L$(NETCDFF_LIBDIR) -Wl,-
rpath=$(NETCDFC_LIBDIR) -L$(NETCDFC_LIBDIR) -Wl,-rpath=$(HDF5_LIBDIR) -
L$(HDF5_LIBDIR) -lhdf5_hl -lhdf5 -lz
Note that the NETCDFLIB is on one line on my file, and the paths of the variables are correct, but the syntax may not be.
Next for the fortran and c compiler information I have the following:
FC = gfortran -m64 -g -O0 -ffixed-line-length-132 -Wunused -Wuninitialized
CC = gcc
CFLAGS = -m64 -c -g -I. -DLONG32 -DUNDERSCORE -DLITTLE -Wunused -
Wuninitialized
Finally, when I run the program I first get a bunch of warnings such as:
oban_namelist.f90:495.29:
real :: flt
1
Warning: Unused variable 'flt' declared at (1)
Followed by a bunch of undefined reference errors such as:
oban.o: In function `check':
/uufs/chpc.utah.edu/common/home/zpu-
group3/dhodges/DART/data/radar/opaws/oban.f90:1902: undefined reference to
`__netcdf_MOD_nf90_strerror'
The error shouldn't be in this oban.o function since I didn't write it. The only things I have edited in the program I listed above for the netcdf path and gfortran/c information and so I think the error lies there. This is my first question on here, so if I missed anything you need feel free to ask. What can I try?
Edit: By request, this is the entire makefile I am using. Also, I just type 'make' to compile it per the instructions in the README file.
# Makefile for creating the OPAWS analysis software
#
# Rev: 02/05/10 LJW
# 12/05/10 DCD
# 02/11/11 LJW
#
# netCDF4 libs - you need to fill in the blanks
NETCDFINC = -I$(NETCDFF_INCDIR) -I$(NETCDFC_INCDIR)
NETCDFLIB = -Wl,-rpath=$(NETCDFF_LIBDIR) -L$(NETCDFF_LIBDIR) -Wl,-rpath=$(NETCDFC_LIBDIR) -L$(NETCDFC_LIBDIR) -Wl,-rpath=$(HDF5_LIBDIR) -
L$(HDF5_LIBDIR) -lhdf5_hl -lhdf5 -lz
# Fortran and C compiler information - various configurations are setup, try and find one close
#=====>> Gfortran
#
FC = gfortran -m64 -g -O0 -ffixed-line-length-132 -Wunused -Wuninitialized
CC = gcc
CFLAGS = -m64 -c -g -I. -DLONG32 -DUNDERSCORE -DLITTLE -Wunused -Wuninitialized
# Leave this stuff alone
EXEC = x.oban
EXECcs = x.clutter_stats
EXECmd = mosaic_2_dart
OBJS = DART.o oban_module.o dict_module.o oban_namelist.o derived_types.o util.o fileio.o read_dorade.o binio.o v5d.o
OBJScs = DART.o dict_module.o oban_namelist.o derived_types.o fileio.o util.o read_dorade.o binio.o v5d.o
OBJSmd = DART.o dict_module.o oban_namelist.o derived_types.o fileio.o util.o read_dorade.o binio.o v5d.o
default: $(EXEC) $(EXECcs) $(EXECmd)
$(EXEC): $(OBJS) oban.o
$(FC) $(OPT) -o $(EXEC) oban.o $(OBJS) $(NETCDFLIB)
$(EXECcs): $(OBJScs) clutter_stats.o
$(FC) $(OPT) -o $(EXECcs) clutter_stats.o $(OBJScs) $(NETCDFLIB)
$(EXECmd): $(OBJSmd) mosaic_2_dart.o
$(FC) $(OPT) -o $(EXECmd) mosaic_2_dart.o $(OBJSmd) $(NETCDFLIB)
clean:
rm $(EXEC) oban.o $(OBJS) $(EXECcs) clutter_stats.o $(OBJScs) $(EXECmd) mosaic_2_dart.o $(OBJSmd) *.mod ncgen.input *.pyc sweep_file_list.txt
# Individual compilation instructions
oban.o: oban.f90 structures.inc opaws.inc DART.o
$(FC) $(OPT) -c $(NETCDFINC) oban.f90
clutter_stats.o: clutter_stats.f90 opaws.inc
$(FC) $(OPT) -c $(NETCDFINC) clutter_stats.f90
mosaic_2_dart.o: mosaic_2_dart.f90 opaws.inc
$(FC) $(OPT) -c $(NETCDFINC) mosaic_2_dart.f90
oban_module.o: oban_module.f90 derived_types.o opaws.inc
$(FC) $(OPT) -c oban_module.f90
read_dorade.o: read_dorade.c read_dorade.h
$(CC) $(CFLAGS) -c read_dorade.c
fileio.o: fileio.f90
$(FC) $(OPT) $(NETCDFINC) -c fileio.f90
util.o: util.f opaws.inc structures.inc
$(FC) $(OPT) -c util.f
DART.o: DART.f
$(FC) $(OPT) -c DART.f
derived_types.o: derived_types.f90
$(FC) $(OPT) -c derived_types.f90
oban_namelist.o: oban_namelist.f90 opaws.inc
$(FC) $(OPT) -c oban_namelist.f90
dict_module.o: dict_module.f90
$(FC) $(OPT) -c dict_module.f90
binio.o: binio.c
$(CC) $(CFLAGS) binio.c -o binio.o
v5d.o: v5d.c
$(CC) $(CFLAGS) v5d.c -o v5d.o
The problem was solved by editing the NETCDFLIB line as follows:
I edited the NETCDFLIB line as follows and it works: NETCDFLIB = -Wl,-
rpath=$(NETCDFF_LIBDIR) -L$(NETCDFF_LIBDIR) -Wl,-rpath=$(NETCDFC_LIBDIR) -
L$(NETCDFC_LIBDIR) -lnetcdff -lnetcdf -lm -Wl,-rpath=$(HDF5_LIBDIR) -
L$(HDF5_LIBDIR) -lhdf5_hl -lhdf5 -lz
Basically I just needed to add:
-lnetcdff -lnetcdf -lm
This allowed for the compiler to get access to the libraries it needed that were originally undefined.
Related
Now I cross-compile and link my code with both dynamic and static libraries, but the following error occurs: can't find lstdc + +(make error 1);
If I changed $LD to $CC, another issues occured: can't find -lpaho-mqtt3a(make error 2), what's going on?
change $(LD)
$(TARGET):$(OBJS)
$(LD) -o $(OUTPUT_DIR)/$(TARGET) $(OBJS) $(CFLAGS_OTHERS_LIB)
$(LIB_FOR_SRS) $(LINK_OPTION)
$(STRIP) $(OUTPUT_DIR)/$(TARGET)
to $(CC)
$(TARGET):$(OBJS)
$(CC) -o $(OUTPUT_DIR)/$(TARGET) $(OBJS) $(CFLAGS_OTHERS_LIB)
$(LIB_FOR_SRS) $(LINK_OPTION)
$(STRIP) $(OUTPUT_DIR)/$(TARGET)
I use these dynamic and static libraries to compile links:
paho-mqtt3a.so libjson-c.a libjson-c.la libsqlite3.so libsqlite3.la libsqlite3.a srs_librtmp.a
libssl.a libcrypto.a
Makefile :
COMPILE = aarch64-linux-gnu-
CC = $(COMPILE)gcc
STRIP = $(COMPILE)strip
LD = $(COMPILE)ld
COMPILE_OPTION = -Wall -Wcomment -Wformat -Wmissing-braces -Wswitch -Wuninitialized
\
-Wbad-function-cast -Waggregate-return -Wmultichar -Wsign-compare -
Wshadow
#COMPILE_OPTION_DEBUG = -gdwarf-2 -g
COMPILE_ALL_OPTION += $(COMPILE_OPTION) $(COMPILE_OPTION_DEBUG)
LINK_OPTION = -lpaho-mqtt3a -ljson-c -lsqlite3 -lm -lc -lpthread -ldl -lstdc++ -static
LIB_FOR_JSON = ./lib/json_lib/*
LIB_FOR_MQTT = ./lib/mqtt_lib/*
LIB_FOR_SQLITE3 = ./lib/sqlite3_lib/*
LIB_FOR_SRS = ./lib/srslibrtmp_lib/*
SRC_DIR = ./src
OUTPUT_DIR = ./output
SYS_LOCAL_LIB_DIR = /usr/local/lib
OBJS_MAIN = main.o
OBJS_EC_UART_232 = ec_uart_232.o
OBJS_EC_UART_485 = ec_uart_485.o
OBJS_EC_MANAGE_PLCE = ec_manage_plce.o
OBJS_EC_SOCKET_VIDEO = ec_socket_video.o
OBJS_EC_MQTT_ANDROID = ec_mqtt_android.o
OBJS_EC_SQLITE = ec_sqlite.o
OBJS_EC_STORE_INFO = ec_store_info.o
OBJS_EC_MANAGE_CAMERA = ec_manage_camera.o
OBJS_DEAL_REQUEST_LOOP = deal_request_loop.o
OBJS_PUSH_VIDEO = push_video.o
TARGET = ecSmartFire
RM = rm -rf
MV = mv
CP = cp -r
LDCONFIG = ldconfig
OBJS = $(OBJS_MAIN) $(OBJS_EC_UART_232) $(OBJS_EC_UART_485) $(OBJS_EC_MANAGE_PLCE)
$(OBJS_EC_SOCKET_VIDEO) \
$(OBJS_EC_MQTT_ANDROID) $(OBJS_EC_SQLITE) $(OBJS_EC_STORE_INFO) $(OBJS_EC_MANAGE_CAMERA)
$(OBJS_DEAL_REQUEST_LOOP) \
$(OBJS_PUSH_VIDEO)
$(TARGET):$(OBJS)
$(LD) -o $(OUTPUT_DIR)/$(TARGET) $(OBJS) $(CFLAGS_OTHERS_LIB) $(LIB_FOR_SRS) $(LINK_OPTION)
$(STRIP) $(OUTPUT_DIR)/$(TARGET)
$(OBJS_MAIN):
$(CC) -c $(SRC_DIR)/main.c $(COMPILE_ALL_OPTION)
$(OBJS_EC_UART_232):
$(CC) -c $(SRC_DIR)/ec_uart_232.c $(COMPILE_ALL_OPTION)
$(OBJS_EC_UART_485):
$(CC) -c $(SRC_DIR)/ec_uart_485.c $(COMPILE_ALL_OPTION)
$(OBJS_EC_MANAGE_PLCE):
$(CC) -c $(SRC_DIR)/ec_manage_plce.c $(COMPILE_ALL_OPTION)
$(OBJS_EC_SOCKET_VIDEO):
$(CC) -c $(SRC_DIR)/ec_socket_video.c $(COMPILE_ALL_OPTION)
$(OBJS_EC_MQTT_ANDROID):
$(CC) -c $(SRC_DIR)/ec_mqtt_android.c $(COMPILE_ALL_OPTION)
$(OBJS_EC_SQLITE):
$(CC) -c $(SRC_DIR)/ec_sqlite.c $(COMPILE_ALL_OPTION)
$(OBJS_EC_STORE_INFO):
$(CC) -c $(SRC_DIR)/ec_store_info.c $(COMPILE_ALL_OPTION)
$(OBJS_EC_MANAGE_CAMERA):
$(CC) -c $(SRC_DIR)/ec_manage_camera.c $(COMPILE_ALL_OPTION)
$(OBJS_DEAL_REQUEST_LOOP):
$(CC) -c $(SRC_DIR)/deal_request_loop.c $(COMPILE_ALL_OPTION)
$(OBJS_PUSH_VIDEO):
$(CC) -c $(SRC_DIR)/push_video.c $(COMPILE_ALL_OPTION)
.PHONY:clean copylib
clean:
-$(RM) $(OUTPUT_DIR)/* $(OBJS)
copylib:
$(CP) $(LIB_FOR_MQTT) $(SYS_LOCAL_LIB_DIR)/
$(CP) $(LIB_FOR_JSON) $(SYS_LOCAL_LIB_DIR)/
$(CP) $(LIB_FOR_SQLITE3) $(SYS_LOCAL_LIB_DIR)/
$(LDCONFIG)
make error 1:
...
no errors
...
aarch64-linux-gnu-gcc -c ./src/ec_store_info.c -Wall -Wcomment -Wformat -Wmissing-braces -
Wswitch -Wuninitialized -Wbad-function-cast -Waggregate-return -Wmultichar -Wsign-compare -
Wshadow
aarch64-linux-gnu-gcc -c ./src/ec_manage_camera.c -Wall -Wcomment -Wformat -Wmissing-braces -
Wswitch -Wuninitialized -Wbad-function-cast -Waggregate-return -Wmultichar -Wsign-compare -
Wshadow
aarch64-linux-gnu-gcc -c ./src/deal_request_loop.c -Wall -Wcomment -Wformat -Wmissing-braces -
Wswitch -Wuninitialized -Wbad-function-cast -Waggregate-return -Wmultichar -Wsign-compare -
Wshadow
aarch64-linux-gnu-gcc -c ./src/push_video.c -Wall -Wcomment -Wformat -Wmissing-braces -Wswitch
-Wuninitialized -Wbad-function-cast -Waggregate-return -Wmultichar -Wsign-compare -Wshadow
./src/push_video.c: In function 'PushVideoToServer':
./src/push_video.c:21:43: warning: pointer targets in passing argument 2 of
'srs_h264_write_raw_frames' differ in signedness [-Wpointer-sign]
ret = srs_h264_write_raw_frames(Rtmp, data, dataSize, DTS, PTS);
^~~~
In file included from ./src/push_video.c:2:
./src/../head/srs_librtmp/srs_librtmp.h:465:12: note: expected 'char *' but argument is of type
'unsigned char *'
extern int srs_h264_write_raw_frames(srs_rtmp_t rtmp, char* frames, int frames_size, uint32_t
dts, uint32_t pts);
^~~~~~~~~~~~~~~~~~~~~~~~~
./src/push_video.c: In function 'PushVideoFunction':
./src/push_video.c:86:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
aarch64-linux-gnu-ld -o ./output/ecSmartFire main.o ec_uart_232.o ec_uart_485.o ec_manage_plce.o
ec_socket_video.o ec_mqtt_android.o ec_sqlite.o ec_store_info.o ec_manage_camera.o
deal_request_loop.o push_video.o ./lib/srslibrtmp_lib/* -lpaho-mqtt3a -ljson-c -lsqlite3 -lm
-lc -lpthread -ldl -lstdc++ -static
aarch64-linux-gnu-ld: cannot find -lstdc++
make: *** [Makefile:51: ecSmartFire] Error 1
make error 2:
...
/usr/lib/gcc-cross/aarch64-linux-gnu/8/../../../../aarch64-linux-
gnu/bin/ld: cannot find -lpaho-mqtt3a
/usr/lib/gcc-cross/aarch64-linux-gnu/8/../../../../aarch64-linux-
gnu/bin/ld: ./lib/srslibrtmp_lib/srs_librtmp.a(srs_lib_simple_socket.o):
in function `srs_hijack_io_connect(void*, char const*, int)':
solved it.
1,as MadScientist said, I always use gcc to compile not ld.
2,I use option -Wl,-Bstatic and -Wl,-Bdynamic to separte static library and dynamic library.
$(TARGET):$(OBJS)
$(CC) -L $(LIB_FOR_SRS) -o $(OUTPUT_DIR)/$(TARGET) $(OBJS) -Wl,-Bstatic -lssl -
lcrypto \
-Wl,-Bdynamic $(DYNAMIC_LINK_OPTION) $(STATIC_LINK_OPTION)
$(STRIP) $(OUTPUT_DIR)/$(TARGET)
I wrote the following makefile:
MAIN = main
# Macro nome compilatore
CC = gcc
# Macro flag del compilatore
CFLAGS = -Wall
# Macro file oggetto
OBJS = $(MAIN).o
# Macro libreria matematica
LIBS = -lm
# Target
$(MAIN): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(MAIN)
When i run it for the first time, the output is:
gcc -Wall -c -o main.o main.c
gcc -Wall main.o -lm -o main
Can you explain me the first line please? What does it mean?
Thank you for your time.
I want to do makefile as the following, but I received this error:
gcc frparse.o frtags.o frscan.o frinit.o frstop.o frfoot.o frio.o -L/usr/local/image/lib/sgi -lioutil -lutil -o frparse
/usr/bin/ld: cannot find -lioutil
collect2: error: ld returned 1 exit status
Makefile:17: recipe for target 'frparse' failed
make: *** [frparse] Error 1
I would appreciate it if you guide me.
IMLIB = /usr/local/image/lib/sgi
LLIBS = -lioutil -lutil
it: frparse frcheck pgrep
OBJ = frparse.o frtags.o frscan.o frinit.o frstop.o frfoot.o frio.o
frparse.o: Makefile frparse.h frio.h frproto.h frstop.h frparse.c
frinit.o: Makefile frparse.h frproto.h frinit.c
frscan.o: Makefile frio.h frstop.h frscan.c
frfoot.o: Makefile frparse.h frproto.h frstop.h frfoot.c
frtags.o: Makefile frparse.h frio.h frproto.h frstop.h frtags.c
frstop.o: Makefile frstop.h frstop.c
frio.o: Makefile frio.c
frparse: $(OBJ)
gcc $(OBJ) -L$(IMLIB) $(LLIBS) -o $#
frcheck: frcheck.o
gcc frcheck.o -L$(IMLIB) $(LLIBS) -o $#
pgrep: pgrep.o
gcc pgrep.o -L$(IMLIB) $(LLIBS) -o $#
.c.o:
# cc -c -O2 -mips2 $<
gcc -c -g $<
regarding:
.c.o:
# cc -c -O2 -mips2 $<
gcc -c -g $<
The comment # must ALSO be indented via a <tab> otherwise the recipe never performs the third line
Also, the syntax is a bit obsolete suggest:
%.o:%.c
for the first line of the recipe
However, regarding your question:
Is there actually a library file named libioutil.so in the directory:
/usr/local/image/lib/sgi
I try to launch my executable but i got this error:
.dudac/stage/monkey/lib/hello.duda: undefined symbol: DDS_sequence_BoardGlobalParameters_BoardGPSoftState__alloc
Whereas link and compile work fine
Here is my makefile:
# ====================================
# Date : Tue 21, Feb 2017 at 10:15
NAME = hello
CC = /opt/windriver/wrlinux-small/7.0-xxxxxx-3543dr/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/arm-wrs-linux-gnueabi/arm-wrs-linux-gnueabi-gcc
CFLAGS = -g -Wall -DDEBUG -L/opt/PrismTech/Vortex_v2/Device/VortexOpenSpliceRTE/6.7.1p2/RTS/armv7at2_vfp_neon.WRlinux7_gcc/lib -ldcpssac -ldcpsisocpp2
#-g -Wall -DDEBUG -fPIC
LDFLAGS =
DEFS =
INCDIR = -I/home/T0181049/.dudac/stage/monkey//include/ -I/home/T0181049/.dudac/stage/monkey//src/include -I/home/T0181049/.dudac/stage/monkey//plugins/duda/src -I/home/T0181049/.dudac/stage/monkey//plugins/duda/ -I/opt/PrismTech/Vortex_v2/Device/VortexOpenSpliceRTE/6.7.1p2/HDE/armv7at2_vfp_neon.WRlinux7_gcc/include -I/opt/PrismTech/Vortex_v2/Device/VortexOpenSpliceRTE/6.7.1p2/HDE/armv7at2_vfp_neon.WRlinux7_gcc/include/dcps/C/SAC -I/opt/PrismTech/Vortex_v2/Device/VortexOpenSpliceRTE/6.7.1p2/HDE/armv7at2_vfp_neon.WRlinux7_gcc/include/sys -I/opt/PrismTech/Vortex_v2/Device/VortexOpenSplice/6.7.1p1/HDE/x86_64.linux/include -I/opt/PrismTech/Vortex_v2/Device/VortexOpenSplice/6.7.1p1/HDE/x86_64.linux/include/sys -I/opt/windriver/wrlinux-small/7.0-xxxxx-3543dr/sysroots/armv7at2-vfp-neon-wrs-linux-gnueabi/usr/include -I/opt/windriver/wrlinux-small/7.0-xxxxx-3543dr/sysroots/armv7at2-vfp-neon-wrs-linux-gnueabi/usr/include/c++ -I/opt/windriver/wrlinux-small/7.0-xxxxxx-3543dr/sysroots/armv7at2-vfp-neon-wrs-linux-gnueabi/usr/include/c++/4.9.1 -I/opt/windriver/wrlinux-small/7.0-xxxxxx-3543dr/sysroots/armv7at2-vfp-neon-wrs-linux-gnueabi/usr/include/c++/4.9.1/arm-windriverv7atneon-linux-gnueabi -I/opt/windriver/wrlinux-small/7.0-xxxxx-3543dr/sysroots/armv7at2-vfp-neon-wrs-linux-gnueabi/usr/include/c++/4.9.1/backward -I/opt/windriver/wrlinux-small/7.0-xxxxx-3543dr/sysroots/armv7at2-vfp-neon-wrs-linux-gnueabi/usr/include/dtc -I/opt/windriver/wrlinux-small/7.0-xxxxxx-3543dr/sysroots/x86_64-wrlinuxsdk-linux/usr/lib/arm-wrs-linux-gnueabi/gcc/arm-wrs-linux-gnueabi/4.9.1/include -I/opt/windriver/wrlinux-small/7.0-xxxxx-3543dr/sysroots/x86_64-wrlinuxsdk-linux/usr/lib/arm-wrs-linux-gnueabi/gcc/arm-wrs-linux-gnueabi/4.9.1/include-fixed
OBJECTS = main.o
_PATH = $(patsubst /%, %, $(CURDIR))
_CC = #/bin/echo -e " [\033[33mCC\033[0m] $#"; $(CC)
_DD = #/bin/echo -e " [\033[32mDD\033[0m] $#"; $(CC)
_CC_QUIET = #/bin/echo -n; $(CC)
all: $(NAME).duda
$(NAME).duda: $(OBJECTS)
$(_DD) $(CFLAGS) $(DEFS) -shared -o $# $^ -lc $(LDFLAGS)
.c.o:
$(_CC) -c $(CFLAGS) $(DEFS) $(INCDIR) -fPIC $<
$(_CC_QUIET) -MM -MP $(CFLAGS) $(DEFS) $(INCDIR) $*.c -o $*.d > /dev/null &2>&1
clean:
rm -rf *.o *.d *~ $(NAME).duda
How do i resolve that ?
Thanks
During linking you have specified libraries that are not in the standard path
Solutions
link statically
Use LD_LIBRARY_PATH
Use LD_PRELOAD
Use rpath
I try to use rpath just like this but got the same error:
CFLAGS = -g -Wall -DDEBUG -L/opt/PrismTech/Vortex_v2/Device/VortexOpenSpliceRTE/6.7.1p2/HDE/armv7at2_vfp_neon.WRlinux7_gcc/lib -Wl,-rpath,/opt/PrismTech/Vortex_v2/Device/VortexOpenSpliceRTE/6.7.1p2/HDE/armv7at2_vfp_neon.WRlinux7_gcc/lib -ldcpssac -ldcpsisocpp2
Here is my makefile code :
CC = gcc
IFLAGS = -Iinclude
CFLAGS = -std=c99 -fPIC -pedantic -Wall -Wextra -c # -march=native -ggdb3
LFLAGS = -shared -lX11 # -march=native -ggdb3
DFLAGS = -L./lib -lOSPOOC
TARGET = lib/libOSPOOC.so
SOURCES = $(shell echo src/*.c)
HEADERS = $(shell echo include/*.h)
OBJECTS = $(patsubst %.c,%.o, $(SOURCES))
# CURLIBPATH = $(PWD)/lib
# LDLIBPATH = $(shell echo $(LD_LIBRARY_PATH) | grep $(CURLIBPATH))
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(LFLAGS) -o $(TARGET) $(OBJECTS)
*.o: *.c
echo allo
$(CC) $(IFLAGS) $(CFLAGS) -o $# $<
demo: $(TARGET) demo/windows.c
$(CC) $(IFLAGS) -o bin/windows demo/windows.c $(DFLAGS)
clean:
rm -r */*.o */*.so bin/*
The rule *.o is not called, and, I don't know how, but it compiles correctly...
Result :
make demo
gcc -std=c99 -fPIC -pedantic -Wall -Wextra -c -c -o src/OSPobj.o src/OSPobj.c
gcc -std=c99 -fPIC -pedantic -Wall -Wextra -c -c -o src/OSPutl.o src/OSPutl.c
gcc -std=c99 -fPIC -pedantic -Wall -Wextra -c -c -o src/OSPwin.o src/OSPwin.c
gcc -shared -lX11 -o lib/libOSPOOC.so src/OSPobj.o src/OSPutl.o src/OSPwin.o
gcc -Iinclude -o bin/windows demo/windows.c -L./lib -lOSPOOC
The problem is that -c is used twice, and echo allo isn't event called...
What do I don't understand, why do I have this strange behaviour?
Ok that's not *.o: *.c but %.o: %.c
*.o is for bash, %.o is for make