diff options
-rw-r--r-- | Makefile | 66 |
1 files changed, 46 insertions, 20 deletions
@@ -1,10 +1,18 @@ +CC=gcc -EXT=pd_$(shell uname -s | sed -e 's/L/l/' | sed -e 's/D/d/') +OS_NAME=$(shell uname -s) -CC=gcc +#echo $(OS_NAME) +# this needs to also recognize MINGW_NT-5.0 +# also, XP uses CYGWIN_NT-5.1 and MINGW_NT-5.1 +ifneq "$(OS_NAME)" "CYGWIN_NT-5.0" +EXT=pd_$(shell uname -s | sed -e 's/L/l/' | sed -e 's/D/d/') # This is Miller's default install location INSTALL_PREFIX=/usr/local/lib/pd +else +EXT=dll +endif # find all files to compile TARGETS=$(subst .tk,.tk2c,$(wildcard */*.tk)) $(subst .c,.$(EXT),$(wildcard */*.c)) @@ -13,34 +21,52 @@ current: $(EXT) .SUFFIXES: .pd_linux .pd_darwin .pd_irix5 .pd_irix6 .dll .tk .tk2c -# ----------------------- NT ----------------------- +# ----------------------- Common ------------------------ + +.tk.tk2c: + ./tk2c.bash < $*.tk > $*.tk2c + -pd_nt: $(NAME).dll +# ----------------------- MINGW-NT ----------------------- -PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo -VC="C:\Program Files\Microsoft Visual Studio\Vc98" +pd_nt: $(TARGETS) -PDNTINCLUDE = /I. /I\tcl\include /I\ftp\pd\src /I$(VC)\include +MINGW_CFLAGS = -DPD -DUNIX -DICECAST -O2 -funroll-loops -fomit-frame-pointer \ + -Wall -W -Wno-shadow -Wstrict-prototypes -g \ + -Wno-unused -Wno-parentheses -Wno-switch \ + -mno-cygwin -c -DBUILD_DLL -PDNTLDIR = $(VC)\lib -PDNTLIB = $(PDNTLDIR)\libc.lib \ - $(PDNTLDIR)\oldnames.lib \ - $(PDNTLDIR)\kernel32.lib \ - \ftp\pd\bin\pd.lib +MINGW_INCLUDE = -I../../src -I../../pd/src -.c.ont: - cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c +MINGW_LFLAGS = -L../../pd/bin -lpd +.c.dll: CURRENT_DIR = `echo $* | cut -d '/' -f 1` .c.dll: - cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c -# need to find a way to replace $(CSYM) -# link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB) + $(CC) $(MINGW_CFLAGS) $(MINGW_INCLUDE) -o $*.o -c $*.c + ld -export_dynamic -shared -o $*.dll $*.o -lc -lm $(MINGW_LFLAGS) +# strip --strip-unneeded $*.dll +# dllwrap --target=i386-mingw32 -mno-cygwin --output-lib=lib$*.a \ +# --dllname=$*.dll --driver-name=gcc $*.o $(MINGW_LFLAGS) +# -rm $*.o -# ----------------------- UNIX Common --------------------- +# PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo +# VC="C:\Program Files\Microsoft Visual Studio\Vc98" -.tk.tk2c: - ./tk2c.bash < $*.tk > $*.tk2c +# PDNTINCLUDE = /I. /I\tcl\include /I\ftp\pd\src /I$(VC)\include +# PDNTLDIR = $(VC)\lib +# PDNTLIB = $(PDNTLDIR)\libc.lib \ +# $(PDNTLDIR)\oldnames.lib \ +# $(PDNTLDIR)\kernel32.lib \ +# \ftp\pd\bin\pd.lib + +# .c.ont: +# cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c + +# .c.dll: +# cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c +# need to find a way to replace $(CSYM) +# link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB) # ----------------------- IRIX 5.x ----------------------- |